Applying black formatting
- Fixing flake8 configuration to agree with black - Adding black validation check to github actions
This commit is contained in:
@@ -7,22 +7,22 @@ this_dir = os.path.dirname(__file__)
|
||||
|
||||
@pytest.fixture
|
||||
def addressbook():
|
||||
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
|
||||
return capnp.load(os.path.join(this_dir, "addressbook.capnp"))
|
||||
|
||||
|
||||
def test_object_basic(addressbook):
|
||||
obj = capnp._MallocMessageBuilder().get_root_as_any()
|
||||
person = obj.as_struct(addressbook.Person)
|
||||
person.name = 'test'
|
||||
person.name = "test"
|
||||
person.id = 1000
|
||||
|
||||
same_person = obj.as_struct(addressbook.Person)
|
||||
assert same_person.name == 'test'
|
||||
assert same_person.name == "test"
|
||||
assert same_person.id == 1000
|
||||
|
||||
obj_r = obj.as_reader()
|
||||
same_person = obj_r.as_struct(addressbook.Person)
|
||||
assert same_person.name == 'test'
|
||||
assert same_person.name == "test"
|
||||
assert same_person.id == 1000
|
||||
|
||||
|
||||
@@ -31,21 +31,21 @@ def test_object_list(addressbook):
|
||||
listSchema = capnp._ListSchema(addressbook.Person)
|
||||
people = obj.init_as_list(listSchema, 2)
|
||||
person = people[0]
|
||||
person.name = 'test'
|
||||
person.name = "test"
|
||||
person.id = 1000
|
||||
person = people[1]
|
||||
person.name = 'test2'
|
||||
person.name = "test2"
|
||||
person.id = 1001
|
||||
|
||||
same_person = obj.as_list(listSchema)
|
||||
assert same_person[0].name == 'test'
|
||||
assert same_person[0].name == "test"
|
||||
assert same_person[0].id == 1000
|
||||
assert same_person[1].name == 'test2'
|
||||
assert same_person[1].name == "test2"
|
||||
assert same_person[1].id == 1001
|
||||
|
||||
obj_r = obj.as_reader()
|
||||
same_person = obj_r.as_list(listSchema)
|
||||
assert same_person[0].name == 'test'
|
||||
assert same_person[0].name == "test"
|
||||
assert same_person[0].id == 1000
|
||||
assert same_person[1].name == 'test2'
|
||||
assert same_person[1].name == "test2"
|
||||
assert same_person[1].id == 1001
|
||||
|
||||
Reference in New Issue
Block a user