Merged revisions 1582-1665 via svnmerge from
[scons.git] / src / engine / SCons / Options / OptionsTests.py
index b908568de1f9ed16f31edbef8cb8a45fe1aeb0e5..1d9b851eb2274f089a2804cc4fefe4c4d14e9e6f 100644 (file)
@@ -29,7 +29,7 @@ import unittest
 import TestSCons
 
 import SCons.Options
-import SCons.Util
+import SCons.Subst
 import SCons.Warnings
 
 
@@ -37,7 +37,7 @@ class Environment:
     def __init__(self):
         self.dict = {}
     def subst(self, x):
-        return SCons.Util.scons_subst(x, self, gvars=self.dict)
+        return SCons.Subst.scons_subst(x, self, gvars=self.dict)
     def __setitem__(self, key, value):
         self.dict[key] = value
     def __getitem__(self, key):
@@ -59,6 +59,19 @@ def checkSave(file, expected):
 
 class OptionsTestCase(unittest.TestCase):
 
+    def test_keys(self):
+        """Test the Options.keys() method"""
+        opts = SCons.Options.Options()
+
+        opts.Add('VAR1')
+        opts.Add('VAR2',
+                 'THE answer to THE question',
+                 "42",
+                 check,
+                 lambda x: int(x) + 12)
+        keys = opts.keys()
+        assert keys == ['VAR1', 'VAR2'], keys
+
     def test_Add(self):
         """Test adding to an Options object"""
         opts = SCons.Options.Options()