def test_generate_golden_file(self): self.call_mock.side_effect = [1, 0] nom_build.main(['nom_build', ':nom:generate_golden_file']) self.call_mock.assert_has_calls([ mock.call([GRADLEW, ':db:test']), mock.call([GRADLEW, ':db:test']) ])
def test_generate_golden_file(self): self.call_mock.side_effect = [1, 0] nom_build.main(['nom_build', ':nom:generate_golden_file']) self.call_mock.assert_has_calls([ mock.call([GRADLEW, ':db:test']), mock.call([ GRADLEW, ':db:test', 'devTool', '--args=-e localhost --log_level=WARNING ' 'generate_sql_er_diagram -o ' '/tmp/rootdir/db/src/main/resources/sql/er_diagram' ]) ])
def test_no_args(self): nom_build.main(['nom_build']) self.assertEqual(self.printed, [ '\x1b[33mWARNING:\x1b[0m No tasks specified. Not ' 'doing anything' ])
def test_property_file_incorrect(self): self.file_contents[PROPERTIES_FILENAME] = 'bad contents' nom_build.main(['nom_build']) self.assertIn('', self.printed[0])
def test_property_file_write(self): nom_build.main(['nom_build', '--generate-gradle-properties']) self.assertEqual(self.file_contents[PROPERTIES_FILENAME], FAKE_PROP_CONTENTS)
def test_generate_golden_file_nofail(self): self.call_mock.return_value = 0 nom_build.main(['nom_build', ':nom:generate_golden_file']) self.call_mock.assert_has_calls([mock.call([GRADLEW, ':db:test'])])
def test_gradle_flags(self): nom_build.main(['nom_build', 'task-name', '-d', '-b', 'foo']) self.call_mock.assert_called_with( [GRADLEW, '--build-file', 'foo', '--debug', 'task-name'])
def test_property_calls(self): nom_build.main(['nom_build', 'task-name', '--testFilter=foo']) self.call_mock.assert_called_with( [GRADLEW, '-P', 'testFilter=foo', 'task-name'])
def test_no_args(self): nom_build.main(['nom_build']) self.assertEqual(self.printed, []) self.call_mock.assert_called_with([GRADLEW])