You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
505 B

  1. from gooey.python_bindings import modules
  2. __author__ = 'Chris'
  3. import unittest
  4. class TestModules(unittest.TestCase):
  5. def test_load_creates_and_imports_module_from_string_source(self):
  6. module_source = '''
  7. some_var = 1234
  8. def fooey():
  9. return 10
  10. '''
  11. module = modules.load(module_source)
  12. self.assertEqual(10, module.fooey())
  13. def test_generate_pyfilename_does_not_begin_with_digit(self):
  14. self.assertTrue(not modules.generate_pyfilename()[0].isdigit())