Exemplo n.º 1
0
def test_file_endings_just_a_dot():
    """
    Tests that a file ending returns if it is a dot file in a directory
    """
    assert CommitParser.get_file_ending("directory/.gitignore") == "gitignore"
Exemplo n.º 2
0
def test_file_endings_no_name():
    """
    Tests that a file ending returns if it has no dot and is in a directory
    """
    assert CommitParser.get_file_ending("directory/noExtension") == "noExtension"
Exemplo n.º 3
0
def test_file_endings_directory():
    """
    Tests that a file ending returns if it is in a directory
    """
    assert CommitParser.get_file_ending("directory/file.py") == "py"
Exemplo n.º 4
0
def test_file_endings_dot():
    """
    Tests that a file ending returns if it is a dot file
    """
    assert CommitParser.get_file_ending(".file") == "file"
Exemplo n.º 5
0
def test_file_endings_no_dot():
    """
    Tests that a file ending returns if there's no dot
    """
    assert CommitParser.get_file_ending("file") == "file"
Exemplo n.º 6
0
def test_file_endings_basic():
    """
    Tests that a file ending returns if there is a dot
    """
    assert CommitParser.get_file_ending("file.py") == "py"
Exemplo n.º 7
0
def test_most_common():
    """
    Test for the most common file ending
    """
    assert set(CommitParser.get_mode_endings(["a", "a", "b", "c", "c", "d"])) == {"a", "c"}