Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(998)

Unified Diff: pylib/gyp/common_test.py

Issue 10876082: Support for newer versions of Solaris and FreeBSD (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: addressed comments and uploaded test Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pylib/gyp/common.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/common_test.py
diff --git a/pylib/gyp/common_test.py b/pylib/gyp/common_test.py
index aabaf344b057f720ff0ae55d6fcd30b2717f128a..dac29692b8640765cb7680d4cb95a94e51734a5f 100755
--- a/pylib/gyp/common_test.py
+++ b/pylib/gyp/common_test.py
@@ -8,6 +8,7 @@
import gyp.common
import unittest
+import sys
class TestTopologicallySorted(unittest.TestCase):
@@ -40,5 +41,31 @@ class TestTopologicallySorted(unittest.TestCase):
graph.keys(), GetEdge)
+class TestGetFlavor(unittest.TestCase):
+ """Test that gyp.common.GetFlavor works as intended"""
+ original_platform = ''
+
+ def setUp(self):
+ self.original_platform = sys.platform
+
+ def tearDown(self):
+ sys.platform = self.original_platform
+
+ def assertFlavor(self, expected, argument, param):
+ sys.platform = argument
+ self.assertEqual(expected, gyp.common.GetFlavor(param))
+
+ def test_platform_default(self):
+ self.assertFlavor('freebsd', 'freebsd9' , {})
+ self.assertFlavor('freebsd', 'freebsd10', {})
+ self.assertFlavor('solaris', 'sunos5' , {});
+ self.assertFlavor('solaris', 'sunos' , {});
+ self.assertFlavor('linux' , 'linux2' , {});
+ self.assertFlavor('linux' , 'linux3' , {});
+
+ def test_param(self):
+ self.assertFlavor('foobar', 'linux2' , {'flavor': 'foobar'})
+
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « pylib/gyp/common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698