Exemplo n.º 1
0
def test_tuple_input(e):
    r = sort_parse(e)
    assert isinstance(r, list)
    assert len(r) == 3
    assert ".".join(r[0][:-1]) == "a"
    assert ".".join(r[1][:-1]) == "b"
    assert ".".join(r[2][:-1]) == "c"
Exemplo n.º 2
0
 def test_tuple_input(self, e):
     r = sort_parse(e)
     assert isinstance(r, list)
     assert len(r) == 3
     assert ".".join(r[0][:-1]) == "a"
     assert ".".join(r[1][:-1]) == "b"
     assert ".".join(r[2][:-1]) == "c"
Exemplo n.º 3
0
def test_unary_tuple_input(e):
    r = sort_parse(e)
    assert isinstance(r, list)
    assert len(r) == 3
    assert ".".join(r[0][:-1]) == "c1"
    assert r[0][-1] == "ASC"
    assert ".".join(r[1][:-1]) == "c2"
    assert r[1][-1] == "DESC"
    assert ".".join(r[2][:-1]) == "c3"
    assert r[2][-1] == "ASC"
Exemplo n.º 4
0
 def test_unary_tuple_input(self, e):
     r = sort_parse(e)
     assert isinstance(r, list)
     assert len(r) == 3
     assert ".".join(r[0][:-1]) == "c1"
     assert r[0][-1] == "ASC"
     assert ".".join(r[1][:-1]) == "c2"
     assert r[1][-1] == "DESC"
     assert ".".join(r[2][:-1]) == "c3"
     assert r[2][-1] == "ASC"
Exemplo n.º 5
0
def test_valid_prefix(e):
    r = sort_parse(e)
    assert ".".join(r[0][:-1]) == e
Exemplo n.º 6
0
def test_unary_name_input(e):
    r = sort_parse(e)
    assert isinstance(r, list)
    assert ".".join(r[0][:-1]) == "name"
Exemplo n.º 7
0
def test_invalid_identifier(e):
    with pytest.raises(InvalidSortError):
        sort_parse(e)
Exemplo n.º 8
0
def test_valid_identifier(e):
    r = sort_parse(e)
    assert ".".join(r[0][:-1]) == e
Exemplo n.º 9
0
def test_invalid_prefix(e):
    with pytest.raises(InvalidSortError):
        sort_parse(e)
Exemplo n.º 10
0
 def test_unary_name_input(self, e):
     r = sort_parse(e)
     assert isinstance(r, list)
     assert ".".join(r[0][:-1]) == "name"
Exemplo n.º 11
0
 def test_name_input(self, e):
     r = sort_parse(e)
     assert isinstance(r, list)
     assert ".".join(r[0][:-1]) == e
Exemplo n.º 12
0
 def test_invalid_identifier(self, e):
     with pytest.raises(InvalidSortError):
         sort_parse(e)
Exemplo n.º 13
0
 def test_valid_identifier(self, e):
     r = sort_parse(e)
     assert ".".join(r[0][:-1]) == e
Exemplo n.º 14
0
 def test_invalid_prefix(self, e):
     with pytest.raises(InvalidSortError):
         sort_parse(e)
Exemplo n.º 15
0
 def test_valid_prefix(self, e):
     r = sort_parse(e)
     assert ".".join(r[0][:-1]) == e