Example #1
0
    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'])
Example #2
0
    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')
Example #3
0
    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''
            ]))
Example #4
0
    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")
Example #5
0
    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',
        ])
Example #6
0
    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")
Example #7
0
    def test_discover_filter_with_excludes_multiple_keys(self):
        s = StringIO()
        cli(out=s)

        self.assertEqual(s.getvalue(), '\n'.join(['dummy-island-service', '']))
Example #8
0
    def test_discover_filter_by_multiple_keys(self):
        s = StringIO()
        cli(out=s)

        self.assertEqual(s.getvalue(), '\n'.join(['dummy-app', '']))
Example #9
0
    def test_discover_filter_by_one_key(self):
        s = StringIO()
        cli(out=s)

        self.assertEqual(s.getvalue(),
                         '\n'.join(['dummy-app', 'dummy-island-service', '']))
Example #10
0
    def test_get_ini_value(self):
        s = StringIO()
        cli(out=s)

        self.assertEqual(s.getvalue(), 'dummy-app:app\n')
Example #11
0
    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'])
Example #12
0
    def test_declare_does_not_call_add_pr_components_labels(self, add_pr):
        s = StringIO()
        cli(out=s)

        add_pr.assert_not_called()
Example #13
0
    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')
Example #14
0
    def test_discover_only_finds_changes(self):
        s = StringIO()
        cli(out=s)

        self.assertEqual(s.getvalue(), '')
Example #15
0
    def test_discover_filter_by_downstream(self):
        s = StringIO()
        cli(out=s)

        self.assertEqual(s.getvalue(), '\n'.join(['dummy-foo', '']))