Skip to content
This repository

Build with 2.6 #17

Merged
merged 2 commits into from about 1 year ago

1 participant

Dave King
Dave King
Owner

No description provided.

Dave King tildedave merged commit 0918035 into from March 24, 2013
Dave King tildedave closed this March 24, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Mar 24, 2013
Dave King Build with 2.6 7472fa1
Dave King Updates to run under Python 2.6. f3e530c
This page is out of date. Refresh to see the latest.
2  .travis.yml
... ...
@@ -1,6 +1,6 @@
1 1
 language: python
2 2
 python:
3  
-# - "2.6"
  3
+  - "2.6"
4 4
   - "2.7"
5 5
 # - "3.2"
6 6
 # command to install dependencies
3  requirements.txt
... ...
@@ -1,2 +1,5 @@
  1
+nose==1.2.1
  2
+unittest2==0.5.1
  3
+mock==1.0.1
1 4
 apache-libcloud>=0.11.4
2 5
 littlechef==1.5.1
35  test/test_runner.py
... ...
@@ -1,4 +1,4 @@
1  
-import unittest
  1
+import unittest2 as unittest
2 2
 import mock
3 3
 from littlechef_rackspace.api import Regions, RackspaceApi
4 4
 from littlechef_rackspace.commands import RackspaceCreate, RackspaceListImages
@@ -49,12 +49,11 @@ def test_must_specify_existing_command(self):
49 49
     def test_list_images_fails_if_configuration_is_not_provided(self):
50 50
         with mock.patch.multiple("littlechef_rackspace.runner", RackspaceApi=self.api_class,
51 51
                                  ChefDeployer=self.deploy_class, RackspaceListImages=self.list_images_class,
52  
-                                 abort=self.abort), \
53  
-             self.assertRaises(AbortException):
54  
-
55  
-            r = Runner(options={})
56  
-            r.main(["list-images"])
57  
-            self.abort.assert_any_call(FailureMessages.NEED_API_KEY)
  52
+                                 abort=self.abort):
  53
+            with self.assertRaises(AbortException):
  54
+                r = Runner(options={})
  55
+                r.main(["list-images"])
  56
+                self.abort.assert_any_call(FailureMessages.NEED_API_KEY)
58 57
 
59 58
     def test_list_images_instantiates_api(self):
60 59
         with mock.patch.multiple("littlechef_rackspace.runner", RackspaceApi=self.api_class,
@@ -77,21 +76,19 @@ def test_uses_config_settings(self):
77 76
 
78 77
     def test_create_fails_if_configuration_is_not_provided(self):
79 78
         r = Runner(options={})
80  
-        with mock.patch.multiple('littlechef_rackspace.runner', abort=self.abort),\
81  
-             self.assertRaises(AbortException):
82  
-
83  
-            r.main(["create"])
84  
-            self.abort.assert_any_call(FailureMessages.NEED_API_KEY)
  79
+        with mock.patch.multiple('littlechef_rackspace.runner', abort=self.abort):
  80
+            with self.assertRaises(AbortException):
  81
+                r.main(["create"])
  82
+                self.abort.assert_any_call(FailureMessages.NEED_API_KEY)
85 83
 
86 84
 
87 85
     def test_create_fails_if_required_arguments_are_not_provided(self):
88  
-        with mock.patch.multiple('littlechef_rackspace.runner', abort=self.abort),\
89  
-            self.assertRaises(AbortException):
90  
-
91  
-            self.create_command.validate_args.return_value = False
92  
-            r = Runner(options={})
93  
-            r.main("create --username username --key deadbeef --region dfw".split(" "))
94  
-            self.abort.assert_any_call(FailureMessages.MISSING_REQUIRED_ARGUMENTS)
  86
+        with mock.patch.multiple('littlechef_rackspace.runner', abort=self.abort):
  87
+            with self.assertRaises(AbortException):
  88
+                self.create_command.validate_args.return_value = False
  89
+                r = Runner(options={})
  90
+                r.main("create --username username --key deadbeef --region dfw".split(" "))
  91
+                self.abort.assert_any_call(FailureMessages.MISSING_REQUIRED_ARGUMENTS)
95 92
 
96 93
     def test_create_instantiates_api_and_deploy_with_default_private_key(self):
97 94
         with mock.patch.multiple("littlechef_rackspace.runner", RackspaceApi=self.api_class,
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.