Example #1
0
 def test_company_success_vmware(self):
     companyData = DBProcessing()
     result = companyData.getCompanyInfo('vmware')
     self.assertTrue(result is not None, "expected a result object")
     self.assertTrue(type(result) == dict, "expected a dictionary")
     self.assertTrue('business' in result, "expected a business tag")
     self.assertTrue('description' in result, "expected a description tag")
     self.assertTrue('date' in result, "expected a date tag")
     self.assertTrue('location' in result, "expected a location tag")
     self.assertTrue('name' in result, "expected a name tag")
     self.assertEqual(result['name'], 'VMWare',
                      'expected "VMWare" instead got %s' % result['name'])
Example #2
0
 def test_company_success_llnl(self):
     companyData = DBProcessing()
     result = companyData.getCompanyInfo('llnl')
     self.assertTrue(result is not None, "expected a result object")
     self.assertTrue(type(result) == dict, "expected a dictionary")
     self.assertTrue('business' in result, "expected a business tag")
     self.assertTrue('description' in result, "expected a description tag")
     self.assertTrue('date' in result, "expected a date tag")
     self.assertTrue('location' in result, "expected a location tag")
     self.assertTrue('name' in result, "expected a name tag")
     self.assertEqual(
         result['name'], 'Lawrence Livermore National Laboratory',
         'expected "Lawrence Livermore National Laboratory" instead got %s'
         % result['name'])
Example #3
0
 def test_company_success_chordiant(self):
     companyData = DBProcessing()
     result = companyData.getCompanyInfo('chordiant')
     self.assertTrue(result is not None, "expected a result object")
     self.assertTrue(type(result) == dict, "expected a dictionary")
     self.assertTrue('business' in result, "expected a business tag")
     self.assertTrue('description' in result, "expected a description tag")
     self.assertTrue('date' in result, "expected a date tag")
     self.assertTrue('location' in result, "expected a location tag")
     self.assertTrue('name' in result, "expected a name tag")
     self.assertEqual(
         result['name'], 'Chordiant (Now Pegasystems)',
         'expected "Chordiant (Now Pegasystems)" instead got %s' %
         result['name'])
Example #4
0
 def test_company_success_niosh(self):
     companyData = DBProcessing()
     result = companyData.getCompanyInfo('niosh')
     self.assertTrue(result is not None, "expected a result object")
     self.assertTrue(type(result) == dict, "expected a dictionary")
     self.assertTrue('business' in result, "expected a business tag")
     self.assertTrue('description' in result, "expected a description tag")
     self.assertTrue('date' in result, "expected a date tag")
     self.assertTrue('location' in result, "expected a location tag")
     self.assertTrue('name' in result, "expected a name tag")
     self.assertEqual(
         result['name'],
         'National Institute of Occupational Safety and Health',
         'expected "National Institute of Occupational Safety and Health" instead got %s'
         % result['name'])
Example #5
0
def getCompanyInfo(companyname):
    companyData = DBProcessing()
    return dumps(companyData.getCompanyInfo(companyname))