Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_init(self):
z = Zipcode(Zipcode="10001")
assert z.Zipcode == "10001"
assert z.ZipcodeType is None
def test_hash(self):
z1 = Zipcode(Zipcode="10001")
z2 = Zipcode(Zipcode="10001")
assert hash(z1) == hash(z2)
assert hash(Zipcode())
s = set([z1, z2])
assert len(s) == 1
def test_hash(self):
z1 = Zipcode(Zipcode="10001")
z2 = Zipcode(Zipcode="10001")
assert hash(z1) == hash(z2)
assert hash(Zipcode())
s = set([z1, z2])
assert len(s) == 1
def test_compare(self):
z1 = Zipcode(Zipcode="10001")
z2 = Zipcode(Zipcode="10002")
z3 = Zipcode()
assert z1 == z1
assert z1 != z2
assert z1 < z2
assert z2 >= z1
with pytest.raises(ValueError):
z1 > z3
with pytest.raises(ValueError):
z3 > z3
def test_output(self):
z = Zipcode(Zipcode="10001", ZipcodeType="Standard")
def test_hash(self):
z1 = Zipcode(Zipcode="10001")
z2 = Zipcode(Zipcode="10001")
assert hash(z1) == hash(z2)
assert hash(Zipcode())
s = set([z1, z2])
assert len(s) == 1
def test_compare(self):
z1 = Zipcode(Zipcode="10001")
z2 = Zipcode(Zipcode="10002")
z3 = Zipcode()
assert z1 == z1
assert z1 != z2
assert z1 < z2
assert z2 >= z1
with pytest.raises(ValueError):
z1 > z3
with pytest.raises(ValueError):
z3 > z3
def test_compare(self):
z1 = Zipcode(Zipcode="10001")
z2 = Zipcode(Zipcode="10002")
z3 = Zipcode()
assert z1 == z1
assert z1 != z2
assert z1 < z2
assert z2 >= z1
with pytest.raises(ValueError):
z1 > z3
with pytest.raises(ValueError):
z3 > z3