def add_dir(self, _path):
     path = file_utils.resource_path(DEV_DIR, os.path.join('devsys', _path))
     if not os.path.exists(path):
         return
     for f in os.listdir(path):
         srn = SystemResourceNames.read_file(os.path.join(path, f))
         self.add(srn)
Ejemplo n.º 2
0
 def add_dir(self, _path):
     path = file_utils.resource_path(DEV_DIR, os.path.join('devsys', _path))
     if not os.path.exists(path):
         return
     for f in os.listdir(path):
         srn = SystemResourceNames.read_file(os.path.join(path, f))
         self.add(srn)
Ejemplo n.º 3
0
 def test_arduino_libs(self):
     for version in ["1.0.6", "1.5.8"]:
         path = os.path.join(os.path.dirname(__file__),
                             '../../../common/dev/devsys/cpp/arduino_all_libs_%s_0' % version)
         if version.startswith('1.5'):
             arduino_headers = arduino_headers_1_5
         else:
             arduino_headers = arduino_headers_1_0
         s = SystemResourceNames.read_file(path)
         for h in arduino_headers.splitlines():
             self.assertIn(h, s.names)
Ejemplo n.º 4
0
class SystemResourceNamesTest(unittest.TestCase):
    def setUp(self):
        self.sut = SystemResourceNames(SystemID("open_gl", "CPP"))

    def test_add_names(self):
        self.sut.add_names(["stdio"])
        self.assertListEqual(self.sut.names, ["stdio"])

    def test_serialize(self):
        self.assertIsInstance(self.sut.serialize(), dict)

    def test_eq_true(self):
        self.assertTrue(self.sut.__eq__(self.sut))
        self.assertTrue(self.sut.__eq__(SystemResourceNames(SystemID("open_gl", "CPP"))))

    def test_eq_false(self):
        system_resource_names = SystemResourceNames(SystemID("open_gl", "CPP"))
        system_resource_names.add_names(["stdio"])
        self.assertFalse(self.sut.__eq__(system_resource_names))
        self.assertFalse(self.sut.__eq__(""))
class SystemResourceNamesTest(unittest.TestCase):

    def setUp(self):
        self.sut = SystemResourceNames(SystemID("open_gl", "CPP"))

    def test_add_names(self):
        self.sut.add_names(["stdio"])
        self.assertListEqual(self.sut.names, ["stdio"])

    def test_serialize(self):
        self.assertIsInstance(self.sut.serialize(), dict)

    def test_eq_true(self):
        self.assertTrue(self.sut.__eq__(self.sut))
        self.assertTrue(self.sut.__eq__(SystemResourceNames(SystemID("open_gl", "CPP"))))

    def test_eq_false(self):
        system_resource_names = SystemResourceNames(SystemID("open_gl", "CPP"))
        system_resource_names.add_names(["stdio"])
        self.assertFalse(self.sut.__eq__(system_resource_names))
        self.assertFalse(self.sut.__eq__(""))
Ejemplo n.º 6
0
 def setUp(self):
     self.sut = SystemResourceNames(SystemID("open_gl", "CPP"))
Ejemplo n.º 7
0
 def test_eq_false(self):
     system_resource_names = SystemResourceNames(SystemID("open_gl", "CPP"))
     system_resource_names.add_names(["stdio"])
     self.assertFalse(self.sut.__eq__(system_resource_names))
     self.assertFalse(self.sut.__eq__(""))
 def setUp(self):
     self.sut = SystemResourceNames(SystemID("open_gl", "CPP"))
 def test_eq_false(self):
     system_resource_names = SystemResourceNames(SystemID("open_gl", "CPP"))
     system_resource_names.add_names(["stdio"])
     self.assertFalse(self.sut.__eq__(system_resource_names))
     self.assertFalse(self.sut.__eq__(""))
Ejemplo n.º 10
0
 def test_eq_true(self):
     self.assertTrue(self.sut.__eq__(self.sut))
     self.assertTrue(self.sut.__eq__(SystemResourceNames(SystemID("open_gl", "CPP"))))
Ejemplo n.º 11
0
 def test_cpp(self):
     path = os.path.join(os.path.dirname(__file__),
                         '../../../common/dev/devsys/cpp/mingw_gcc_0')
     s = SystemResourceNames.read_file(path)
     for h in cpp_headers.splitlines():
         self.assertIn(h, s.names)
Ejemplo n.º 12
0
 def test_node(self):
     path = os.path.join(os.path.dirname(__file__),
                         '../../../common/dev/devsys/js/node-v0.10.13_0')
     s = SystemResourceNames.read_file(path)
     for h in node_files.splitlines():
         self.assertIn(h, s.names)
Ejemplo n.º 13
0
 def test_python(self):
     path = os.path.join(os.path.dirname(__file__),
                         '../../../common/dev/devsys/python/python27_0')
     s = SystemResourceNames.read_file(path)
     for h in python_files.splitlines():
         self.assertIn(h, s.names)