Ejemplo n.º 1
0
 def test_id_provided(self):
     params = {'YAML': 'services: {}',
               'Version': 4,
               'BundleID': '~jorge/wiki'}
     results = views._validate_import_params(params)
     expected = ('bundle-v4', {'services': {}}, 4, '~jorge/wiki')
     self.assertEqual(expected, results)
Ejemplo n.º 2
0
 def test_id_and_name_provided(self):
     params = {'YAML': 'mybundle: {services: {}}',
               'Name': 'mybundle',
               'BundleID': '~jorge/wiki/3/smallwiki'}
     results = views._validate_import_params(params)
     expected = ('mybundle', {'services': {}}, 3, '~jorge/wiki/3/smallwiki')
     self.assertEqual(expected, results)
Ejemplo n.º 3
0
 def test_no_name_success(self):
     # The process succeeds if the bundle name is not provided but the
     # YAML contents include just one bundle.
     params = {'YAML': 'mybundle: {services: {}}'}
     results = views._validate_import_params(params)
     expected = ('mybundle', {'services': {}}, 3, None)
     self.assertEqual(expected, results)
Ejemplo n.º 4
0
 def test_no_name_success(self):
     # The process succeeds if the bundle name is not provided but the
     # YAML contents include just one bundle.
     params = {'YAML': 'mybundle: {services: {}}'}
     results = views._validate_import_params(params)
     expected = ('mybundle', {'services': {}}, 3, None)
     self.assertEqual(expected, results)
Ejemplo n.º 5
0
 def test_id_provided(self):
     params = {
         'YAML': 'mybundle: {services: {}}',
         'BundleID': '~jorge/wiki/3/smallwiki'
     }
     results = views._validate_import_params(params)
     expected = ('mybundle', {'services': {}}, 3, '~jorge/wiki/3/smallwiki')
     self.assertEqual(expected, results)
Ejemplo n.º 6
0
 def test_id_provided(self):
     params = {
         'YAML': 'services: {}',
         'Version': 4,
         'BundleID': '~jorge/wiki'
     }
     results = views._validate_import_params(params)
     expected = ('bundle-v4', {'services': {}}, 4, '~jorge/wiki')
     self.assertEqual(expected, results)