예제 #1
0
 def test_build_python_wheel_fail(self, m1, m2):
     conf = {**takeoff_config(), **BASE_CONF}
     with pytest.raises(ChildProcessError):
         with mock.patch("takeoff.build_artifact.run_shell_command",
                         return_value=(1, ['output_lines'])) as m:
             victim(FAKE_ENV, conf).build_sbt_assembly_jar()
         m.assert_called_once_with(["sbt", "clean", "assembly"])
예제 #2
0
    def test_write_version(self):
        mopen = mock.mock_open()
        conf = {**takeoff_config(), **BASE_CONF}
        with mock.patch("builtins.open", mopen):
            victim(FAKE_ENV, conf)._write_version()

        mopen.assert_called_once_with("version.py", "w+")
        handle = mopen()
        handle.write.assert_called_once_with("__version__='v'")
예제 #3
0
 def test_build_python_wheel(self, m1, m2):
     conf = {**takeoff_config(), **BASE_CONF}
     with mock.patch("takeoff.build_artifact.run_shell_command",
                     return_value=(0, ['output_lines'])) as m:
         victim(FAKE_ENV, conf).build_python_wheel()
     m.assert_called_once_with(["python", "setup.py", "bdist_wheel"])
예제 #4
0
    def test_build_sbt(self):
        conf = {**takeoff_config(), **BASE_CONF, "build_tool": "sbt"}

        with mock.patch.object(victim, "build_sbt_assembly_jar") as m:
            victim(FAKE_ENV, conf).run()
        m.assert_called_once()
예제 #5
0
    def test_build_python(self):
        conf = {**takeoff_config(), **BASE_CONF}

        with mock.patch.object(victim, "build_python_wheel") as m:
            victim(FAKE_ENV, conf).run()
        m.assert_called_once()
예제 #6
0
    def test_validate_minimal_schema(self):
        conf = {**takeoff_config(), **BASE_CONF}

        victim(FAKE_ENV, conf)