Skip to content

Commit c86c9eb

Browse files
committed
Tested entity base endpoints
1 parent 272c0c8 commit c86c9eb

3 files changed

Lines changed: 13 additions & 28 deletions

File tree

bugout/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
__email__ = "engineering@bugout.dev"
99
__license__ = "MIT"
10-
__version__ = "0.2.10"
10+
__version__ = "0.2.11"
1111

1212
__all__ = (
1313
"__author__",

bugout/app.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -934,13 +934,11 @@ def create_entities_pack(
934934
**kwargs: Dict[str, Any],
935935
) -> data.BugoutJournalEntities:
936936
self.journal.timeout = timeout
937-
entities_obj = [
938-
data.BugoutJournalEntityRequest(**entity) for entity in entities
939-
]
937+
940938
return self.journal.create_entities_pack(
941939
token=token,
942940
journal_id=journal_id,
943-
entries=entities_obj,
941+
entities=[data.BugoutJournalEntityRequest(**entity) for entity in entities],
944942
auth_type=data.AuthType[auth_type],
945943
**kwargs,
946944
)

bugout/journal.py

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,14 @@
44
from typing import Any, Dict, List, Optional, Union
55

66
from .calls import make_request
7-
from .data import (
8-
AuthType,
9-
BugoutJournal,
10-
BugoutJournalEntities,
11-
BugoutJournalEntity,
12-
BugoutJournalEntityRequest,
13-
BugoutJournalEntries,
14-
BugoutJournalEntriesRequest,
15-
BugoutJournalEntriesTagsRequest,
16-
BugoutJournalEntry,
17-
BugoutJournalEntryContent,
18-
BugoutJournalEntryTags,
19-
BugoutJournalPermissions,
20-
BugoutJournals,
21-
BugoutJournalScopeSpecs,
22-
BugoutScopes,
23-
BugoutSearchResults,
24-
HolderType,
25-
JournalTypes,
26-
Method,
27-
)
7+
from .data import (AuthType, BugoutJournal, BugoutJournalEntities,
8+
BugoutJournalEntity, BugoutJournalEntityRequest,
9+
BugoutJournalEntries, BugoutJournalEntriesRequest,
10+
BugoutJournalEntriesTagsRequest, BugoutJournalEntry,
11+
BugoutJournalEntryContent, BugoutJournalEntryTags,
12+
BugoutJournalPermissions, BugoutJournals,
13+
BugoutJournalScopeSpecs, BugoutScopes, BugoutSearchResults,
14+
HolderType, JournalTypes, Method)
2815
from .exceptions import InvalidUrlSpec
2916
from .settings import REQUESTS_TIMEOUT
3017

@@ -624,7 +611,7 @@ def create_entities_pack(
624611
"address": entity.address,
625612
"blockchain": entity.blockchain,
626613
"required_fields": entity.required_fields,
627-
"secondary_fields": entity.extra,
614+
**entity.extra,
628615
}
629616
for entity in entities
630617
]
@@ -701,7 +688,7 @@ def update_entity(
701688
)
702689
return BugoutJournalEntity(**result)
703690

704-
def delete_entry(
691+
def delete_entity(
705692
self,
706693
token: Union[str, uuid.UUID],
707694
journal_id: Union[str, uuid.UUID],

0 commit comments

Comments
 (0)