Beispiel #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"
Beispiel #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"
Beispiel #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"
Beispiel #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"
Beispiel #5
0
def test_valid_prefix(e):
    r = sort_parse(e)
    assert ".".join(r[0][:-1]) == e
Beispiel #6
0
def test_unary_name_input(e):
    r = sort_parse(e)
    assert isinstance(r, list)
    assert ".".join(r[0][:-1]) == "name"
Beispiel #7
0
def test_invalid_identifier(e):
    with pytest.raises(InvalidSortError):
        sort_parse(e)
Beispiel #8
0
def test_valid_identifier(e):
    r = sort_parse(e)
    assert ".".join(r[0][:-1]) == e
Beispiel #9
0
def test_invalid_prefix(e):
    with pytest.raises(InvalidSortError):
        sort_parse(e)
Beispiel #10
0
 def test_unary_name_input(self, e):
     r = sort_parse(e)
     assert isinstance(r, list)
     assert ".".join(r[0][:-1]) == "name"
Beispiel #11
0
 def test_name_input(self, e):
     r = sort_parse(e)
     assert isinstance(r, list)
     assert ".".join(r[0][:-1]) == e
Beispiel #12
0
 def test_invalid_identifier(self, e):
     with pytest.raises(InvalidSortError):
         sort_parse(e)
Beispiel #13
0
 def test_valid_identifier(self, e):
     r = sort_parse(e)
     assert ".".join(r[0][:-1]) == e
Beispiel #14
0
 def test_invalid_prefix(self, e):
     with pytest.raises(InvalidSortError):
         sort_parse(e)
Beispiel #15
0
 def test_valid_prefix(self, e):
     r = sort_parse(e)
     assert ".".join(r[0][:-1]) == e