Bug 1296530 - Add a test for unexpected keyword argument to @depends. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 12 Oct 2016 13:48:23 +0900
changeset 425035 370840715b43ecba02afe2162a678e1a70385c00
parent 425034 e4e0ec46b30ed1a8fe8c7812de6551bd4d22bfc7
child 425036 499adad7b025e63760f2ac19208efac6a2c481a7
push id32321
push userbmo:mh+mozilla@glandium.org
push dateFri, 14 Oct 2016 02:53:47 +0000
reviewerschmanchester
bugs1296530
milestone52.0a1
Bug 1296530 - Add a test for unexpected keyword argument to @depends. r?chmanchester
python/mozbuild/mozbuild/test/configure/test_configure.py
--- a/python/mozbuild/mozbuild/test/configure/test_configure.py
+++ b/python/mozbuild/mozbuild/test/configure/test_configure.py
@@ -862,16 +862,27 @@ class TestConfigure(unittest.TestCase):
 
                 foo()
             '''):
                 self.get_config()
 
         self.assertEquals(e.exception.message,
                           "The `foo` function may not be called")
 
+        with self.assertRaises(TypeError) as e:
+            with self.moz_configure('''
+                @depends('--help', foo=42)
+                def foo(_):
+                    return
+            '''):
+                self.get_config()
+
+        self.assertEquals(e.exception.message,
+                          "depends_impl() got an unexpected keyword argument 'foo'")
+
     def test_imports_failures(self):
         with self.assertRaises(ConfigureError) as e:
             with self.moz_configure('''
                 @imports('os')
                 @template
                 def foo(value):
                     return value
             '''):