Beispiel #1
0
def test_rm(*_):
    args = argparse.Namespace()
    args.repo = ['repo1']
    with patch('builtins.open', mock_open()) as mock_file:
        __main__.f_rm(args)
    mock_file.assert_called_with('some path', 'w')
    handle = mock_file()
    handle.write.assert_called_once_with('/b/')
Beispiel #2
0
def test_rm(mock_write, *_):
    args = argparse.Namespace()
    args.repo = ["repo1"]
    __main__.f_rm(args)
    mock_write.assert_called_once_with({"repo2": {"path": "/b/", "type": ""}}, "w")
Beispiel #3
0
def test_rm(mock_write, *_):
    args = argparse.Namespace()
    args.repo = ['repo1']
    __main__.f_rm(args)
    mock_write.assert_called_once_with({'repo2': '/b/'}, 'w')