def test_returns_null_if_invalid_code(self):
        result = parse("WTF4")
        expect(result).to_be_null()

        result = parse("")
        expect(result).to_be_null()

        result = parse("IAD")
        expect(result).to_be_null()
Exemplo n.º 2
0
    def test_returns_null_if_invalid_code(self):
        result = parse("WTF4")
        expect(result).to_be_null()

        result = parse("")
        expect(result).to_be_null()

        result = parse("IAD")
        expect(result).to_be_null()
Exemplo n.º 3
0
    def test_can_parse_code(self):
        result = parse("IAD2")
        expect(result).not_to_be_null()
        expect(result).to_be_instance_of(dict)

        result = parse("NRT12-C1")
        expect(result).not_to_be_null()
        expect(result).to_be_instance_of(dict)

        result = parse("MIA3-C1")
        expect(result).not_to_be_null()
        expect(result).to_be_instance_of(dict)
def can_validate_code(code, node_name, node_index):
    parsed_code = parse(code)
    expect(parsed_code).not_to_be_null()
    expect(parsed_code).to_be_instance_of(dict)
    expect(parsed_code['code']).to_equal(code)
    expect(parsed_code['name']).to_equal(node_name)
    expect(parsed_code['number']).to_equal(node_index)
    expect(parsed_code).to_include('reference')
    expect(parsed_code).to_include('city')
    expect(parsed_code).to_include('state')
    expect(parsed_code).to_include('country')
Exemplo n.º 5
0
def can_validate_code(code, node_name, node_index):
    parsed_code = parse(code)
    expect(parsed_code).not_to_be_null()
    expect(parsed_code).to_be_instance_of(dict)
    expect(parsed_code['code']).to_equal(code)
    expect(parsed_code['name']).to_equal(node_name)
    expect(parsed_code['number']).to_equal(node_index)
    expect(parsed_code).to_include('reference')
    expect(parsed_code).to_include('city')
    expect(parsed_code).to_include('state')
    expect(parsed_code).to_include('country')
Exemplo n.º 6
0
 def test_can_parse_code(self):
     result = parse("IAD2")
     expect(result).not_to_be_null()
     expect(result).to_be_instance_of(dict)