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