def test_validate_port_too_high(self): self.assertTrue(validate_port(49151)) self.assertFalse(validate_port(49152))
def test_validate_port_wrong_type(self): self.assertFalse(validate_port("1908"))
def test_validate_port_too_low(self): self.assertFalse(validate_port(-1)) self.assertTrue(validate_port(0))
def test_validate_port(self): """ A port should be an integer within the correct range. """ self.assertTrue(validate_port(1908))