~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to tests/test_candidate.py

  • Committer: Aaron Bentley
  • Date: 2016-04-24 16:09:49 UTC
  • mto: This revision was merged to the branch mainline in revision 1372.
  • Revision ID: aaron.bentley@canonical.com-20160424160949-6x1jdnkkpkcd820m
Rename create_model to add_model.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    extract_candidates,
10
10
    find_publish_revision_number,
11
11
    get_artifact_dirs,
 
12
    get_build_parameters,
12
13
    get_package,
13
14
    get_scripts,
14
15
    parse_args,
28
29
            'password1'])
29
30
        self.assertEqual(credentials, Credentials('jrandom', 'password1'))
30
31
 
 
32
    def test_get_build_parameters(self):
 
33
        build_data = {
 
34
            "actions": [
 
35
                {
 
36
                    "parameters": [
 
37
                        {
 
38
                            "name": "revision_build",
 
39
                            "value": "2138"
 
40
                        }
 
41
                    ]
 
42
                },
 
43
                {
 
44
                    "causes": [
 
45
                        {
 
46
                            "shortDescription": "Started by user admin",
 
47
                            "userName": "admin"
 
48
                        }
 
49
                    ]
 
50
                },
 
51
                {},
 
52
                {}
 
53
            ],
 
54
            "number": 1256
 
55
        }
 
56
        parameters = get_build_parameters(build_data)
 
57
        self.assertEqual('2138', parameters['revision_build'])
 
58
 
31
59
    @staticmethod
32
60
    def make_publish_revision_build_data(*args, **kwargs):
33
61
        if kwargs['build'] == 'lastSuccessfulBuild':