def test_deploy_space_build_call(mocker):

    mocker.patch("os.listdir")
    mocker.patch("os.path.isfile")
    mocker.patch("os.path.isdir")

    os.listdir.return_value = ["Dashboard", "Look"]
    os.path.isfile.return_value = True
    os.path.isdir.return_value = True

    mocker.patch("looker_deployer.commands.deploy_content.build_spaces")
    mocker.patch("looker_deployer.commands.deploy_content.import_content")
    deploy_content.deploy_space("Foo/Shared/Bar/", "sdk", "env", "ini", False, False)
    deploy_content.build_spaces.assert_called_with(["Shared", "Bar"], "sdk")
def test_deploy_space_look_call(mocker):

    mocker.patch("os.listdir")
    mocker.patch("os.path.isfile")
    mocker.patch("os.path.isdir")

    os.listdir.return_value = ["Look_test"]
    os.path.isfile.return_value = True
    os.path.isdir.return_value = True

    mocker.patch("looker_deployer.commands.deploy_content.build_spaces")
    deploy_content.build_spaces.return_value = "42"

    mocker.patch("looker_deployer.commands.deploy_content.import_content")
    deploy_content.deploy_space("Foo/Shared/Bar", "sdk", "env", "ini", False, False)
    deploy_content.import_content.assert_called_once_with("look", "Foo/Shared/Bar/Look_test", "42", "env", "ini", False)