Exemple #1
0
def test_add_file_when_already_added(mock_exists):
    state = State()
    state.add_height_file('mylittletestfile')
    result = state.add_height_file('mylittletestfile')
    assert result == FileAddResult.ALREADY_ADDED
    assert 1 == len(state.height_files)
    assert path.abspath('mylittletestfile') in state.height_files
Exemple #2
0
def test_add_file_when_success(mock_exists):
    state = State()
    result = state.add_height_file('mylittletestfile')
    mock_exists.assert_called()
    assert result == FileAddResult.SUCCESS
    assert 1 == len(state.height_files)
    assert path.abspath('mylittletestfile') in state.height_files
Exemple #3
0
def test_has_height_files():
    state = State()
    assert not state.has_height_files()
    state.add_height_file('asd')
    assert state.has_height_files()