def test_parallel_build_count_returns_build_count_from_project(self): options = unit.MockOptions(disable_parallel=False) plugin = snapcraft.BasePlugin("test_plugin", options, self.project_options) unittest.mock.patch.object(self.project_options, "parallel_build_count", 2) self.assertThat(plugin.parallel_build_count, Equals(2))
def test_parallel_build_count_returns_1_when_disabled(self): options = unit.MockOptions(disable_parallel=True) plugin = snapcraft.BasePlugin("test_plugin", options, self.project_options) self.assertThat(plugin.parallel_build_count, Equals(1))
def test_cross_compilation_raises(self): options = unit.MockOptions(disable_parallel=True) plugin = snapcraft.BasePlugin("test_plugin", options, self.project_options) self.assertRaises(errors.CrossCompilationNotSupported, plugin.enable_cross_compilation)