def test_length(self, string, args, name, value, valid): bucket = Bucket(*args) expected = 2 if '=' in string else 1 assert len(bucket) == expected
def test_strict_string_failure(self, string, args, name, value, valid): with pytest.raises(ValueError): Bucket(string, strict=True)
def test_not_equal_comparison(self, string, args, name, value, valid): bucket = Bucket(*args) assert bucket != "xxx"
def test_repr(self, string, args, name, value, valid): bucket = Bucket(*args) assert repr(bucket) == "Bucket(" + str(bucket) + ")"
def test_unequal_comparison(self, string, args, name, value, valid): bucket = Bucket(*args) assert not (bucket == "xxx")
def test_identity_comparison(self, string, args, name, value, valid): bucket = Bucket(string) assert bucket == string
def test_validity(self, string, args, name, value, valid): bucket = Bucket(string) assert bucket.valid == valid
def test_values(self, string, args, name, value, valid): bucket = Bucket(*args) assert bucket.value == value
def test_string_identity(self, string, args, name, value, valid): bucket = Bucket(string) assert str(bucket) == string