Beispiel #1
0
    def test_valid_codes(self):
        """
        All other codes are considered valid (or are undefined by the spec).
        """
        valid_codes = range(1000, 1004) + range(1007, 1012)

        for code in valid_codes:
            self.assertTrue(hybi.is_valid_close_code(code))
Beispiel #2
0
    def test_invalid_codes(self):
        """
        A number of codes are reserved/considered invalid by the spec.
        """
        invalid_codes = [999, 1100] + \
            range(1004, 1006) + \
            range(1012, 1016) + \
            range(2000, 2999)

        for code in invalid_codes:
            self.assertFalse(hybi.is_valid_close_code(code))