def test_declare_calls_add_pr_components_labels_correctly(self, add_pr): s = StringIO() cli(out=s) add_pr.assert_called_once_with( 'http://github.com/ployst/ployst/pulls/1', ['dummy-app', 'dummy-integration'])
def test_get_downstream_components(self, add_pr): s = StringIO() cli(out=s) self.assertEqual( s.getvalue(), 'dummy-foo:dummy-foo-integration-builder,dummy-integration\n')
def test_discover_without_versions(self): s = StringIO() cli(out=s) self.assertEqual( sorted(s.getvalue().split('\n')), sorted([ u'dummy-app', u'dummy-integration', u'dummy-island-service', u'dummy-foo', u'dummy-foo-integration-builder', u'' ]))
def test_individual_custom_commands(self): script_out = '/tmp/foo-out' try: os.remove(script_out) except OSError: pass cli() self.assertEqual(open(script_out).read(), "bar dummy-foo\n")
def test_discover_with_versions(self): s = StringIO() cli(out=s) self.assertEqual(sorted(s.getvalue().split('\n')), [ u'', u'dummy-app:5.4.1', u'dummy-foo-integration-builder:2.0.1', u'dummy-foo:1.0.1', u'dummy-integration:2.0.1', u'dummy-island-service:1.5.1', ])
def test_pre_step_scripts(self): script_out = '/tmp/foo-out' try: os.remove(script_out) except OSError: pass cli() self.assertEqual( open(script_out).read(), "bar dummy-app\nbar dummy-island-service\nbar dummy-foo\n" "bar dummy-foo-integration-builder\nbar dummy-integration\n")
def test_discover_filter_with_excludes_multiple_keys(self): s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), '\n'.join(['dummy-island-service', '']))
def test_discover_filter_by_multiple_keys(self): s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), '\n'.join(['dummy-app', '']))
def test_discover_filter_by_one_key(self): s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), '\n'.join(['dummy-app', 'dummy-island-service', '']))
def test_get_ini_value(self): s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), 'dummy-app:app\n')
def test_exclude_downstream(self, add_pr): s = StringIO() cli(out=s) add_pr.assert_called_once_with( 'http://github.com/ployst/ployst/pulls/1', ['dummy-app'])
def test_declare_does_not_call_add_pr_components_labels(self, add_pr): s = StringIO() cli(out=s) add_pr.assert_not_called()
def test_discover_local_uncommitted_changes_count(self): setup_changed_file(self, 'dummy-island-service') s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), 'dummy-island-service\n')
def test_discover_only_finds_changes(self): s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), '')
def test_discover_filter_by_downstream(self): s = StringIO() cli(out=s) self.assertEqual(s.getvalue(), '\n'.join(['dummy-foo', '']))