def test_mk(mk_fixture): """Testing mk command.""" filename, pre_exist, post_exist = mk_fixture assert os.path.isfile(filename) == pre_exist mk(filename) assert os.path.isfile(filename) == post_exist
def test_contains_success(): """Test contains_success.""" mk(TXT_FILENAME) assert contains(TXT_FILENAME) == 0 rm(TXT_FILENAME)
def test_mk_no_filename(): """Test mk_no_filename.""" assert mk() == INV_ARG
def test_mk(mk_fixture): """mk tests.""" assert mk(mk_fixture[0]) == mk_fixture[1]
def test_mk_invalid_filename(tmp_path): """Test mk_invalid_filename.""" filename = tmp_path / 'f/1/l/e.txt' assert mk(filename) == 'invalid filename'
def test_mk_duplicate(tmp_path): """Test mk_duplicate.""" filename = tmp_path / TXT_FILENAME filename.write_text(TXTSTR) assert mk(filename) == 'file already exists'
def test_mk_ru_filename(tmp_path): """Test mk_ru_filename.""" filename = tmp_path / 'файл.txt' assert mk(filename) == 'success'
def test_mk_en_filename(tmp_path): """Test mk_en_filename.""" filename = tmp_path / TXT_FILENAME assert mk(filename) == 'success'
def test_mk(fixture_mk): """Test mk function.""" filename, expected = fixture_mk with expected: mk(filename)