mirror of https://github.com/borgbackup/borg.git
add more tests
This commit is contained in:
parent
e81407ff81
commit
46362a1962
|
@ -40,11 +40,24 @@ def test_item_from_dict():
|
|||
assert item.mode == 0o666
|
||||
assert 'path' in item
|
||||
|
||||
# does not matter whether we get str or bytes keys
|
||||
item = Item({'path': b'/a/b/c', 'mode': 0o666})
|
||||
assert item.path == '/a/b/c'
|
||||
assert item.mode == 0o666
|
||||
assert 'mode' in item
|
||||
|
||||
# invalid - no dict
|
||||
with pytest.raises(TypeError):
|
||||
Item(42)
|
||||
|
||||
# invalid - no bytes/str key
|
||||
with pytest.raises(TypeError):
|
||||
Item({42: 23})
|
||||
|
||||
# invalid - unknown key
|
||||
with pytest.raises(ValueError):
|
||||
Item({'foobar': 'baz'})
|
||||
|
||||
|
||||
def test_item_from_kw():
|
||||
item = Item(path=b'/a/b/c', mode=0o666)
|
||||
|
|
Loading…
Reference in New Issue