~suutari-olli/openlp/click-slide-to-go-live-from-blank

« back to all changes in this revision

Viewing changes to tests/functional/openlp_core/test_init.py

  • Committer: Simon Hanna
  • Date: 2016-05-17 08:48:19 UTC
  • mfrom: (2625.1.36 openlp)
  • mto: (2625.1.37 openlp)
  • mto: This revision was merged to the branch mainline in revision 2649.
  • Revision ID: simon.hanna@serve-me.info-20160517084819-lgup78nzyzjympuu
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        # GIVEN: a a set of system arguments.
38
38
        sys.argv[1:] = []
39
39
        # WHEN: We we parse them to expand to options
40
 
        args = parse_options()
 
40
        args = parse_options(None)
41
41
        # THEN: the following fields will have been extracted.
42
42
        self.assertFalse(args.dev_version, 'The dev_version flag should be False')
43
43
        self.assertEquals(args.loglevel, 'warning', 'The log level should be set to warning')
54
54
        # GIVEN: a a set of system arguments.
55
55
        sys.argv[1:] = ['-l debug']
56
56
        # WHEN: We we parse them to expand to options
57
 
        args = parse_options()
 
57
        args = parse_options(None)
58
58
        # THEN: the following fields will have been extracted.
59
59
        self.assertFalse(args.dev_version, 'The dev_version flag should be False')
60
60
        self.assertEquals(args.loglevel, ' debug', 'The log level should be set to debug')
71
71
        # GIVEN: a a set of system arguments.
72
72
        sys.argv[1:] = ['--portable']
73
73
        # WHEN: We we parse them to expand to options
74
 
        args = parse_options()
 
74
        args = parse_options(None)
75
75
        # THEN: the following fields will have been extracted.
76
76
        self.assertFalse(args.dev_version, 'The dev_version flag should be False')
77
77
        self.assertEquals(args.loglevel, 'warning', 'The log level should be set to warning')
88
88
        # GIVEN: a a set of system arguments.
89
89
        sys.argv[1:] = ['-l debug', '-d']
90
90
        # WHEN: We we parse them to expand to options
91
 
        args = parse_options()
 
91
        args = parse_options(None)
92
92
        # THEN: the following fields will have been extracted.
93
93
        self.assertTrue(args.dev_version, 'The dev_version flag should be True')
94
94
        self.assertEquals(args.loglevel, ' debug', 'The log level should be set to debug')
105
105
        # GIVEN: a a set of system arguments.
106
106
        sys.argv[1:] = ['dummy_temp']
107
107
        # WHEN: We we parse them to expand to options
108
 
        args = parse_options()
 
108
        args = parse_options(None)
109
109
        # THEN: the following fields will have been extracted.
110
110
        self.assertFalse(args.dev_version, 'The dev_version flag should be False')
111
111
        self.assertEquals(args.loglevel, 'warning', 'The log level should be set to warning')
122
122
        # GIVEN: a a set of system arguments.
123
123
        sys.argv[1:] = ['-l debug', 'dummy_temp']
124
124
        # WHEN: We we parse them to expand to options
125
 
        args = parse_options()
 
125
        args = parse_options(None)
126
126
        # THEN: the following fields will have been extracted.
127
127
        self.assertFalse(args.dev_version, 'The dev_version flag should be False')
128
128
        self.assertEquals(args.loglevel, ' debug', 'The log level should be set to debug')
130
130
        self.assertFalse(args.portable, 'The portable flag should be set to false')
131
131
        self.assertEquals(args.style, None, 'There are no style flags to be processed')
132
132
        self.assertEquals(args.rargs, 'dummy_temp', 'The service file should not be blank')
133
 
 
134
 
    def parse_options_two_files_test(self):
135
 
        """
136
 
        Test the parse options process works with a file
137
 
 
138
 
        """
139
 
        # GIVEN: a a set of system arguments.
140
 
        sys.argv[1:] = ['dummy_temp', 'dummy_temp2']
141
 
        # WHEN: We we parse them to expand to options
142
 
        args = parse_options()
143
 
        # THEN: the following fields will have been extracted.
144
 
        self.assertEquals(args, None, 'The args should be None')