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'])
def test_school_fail(self): schoolData = DBProcessing() result = schoolData.getSchoolInfo('ineverwentthere') self.assertTrue(result is not None, "expected a result object") self.assertTrue(type(result) == dict, "expected a dictionary") self.assertTrue('degree' in result, "expected a degree 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'], 'ineverwentthere', 'expected "ineverwentthere" instead got %s' % result['name'])
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'])
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'])
def test_school_success_cmu(self): schoolData = DBProcessing() result = schoolData.getSchoolInfo('cmu') self.assertTrue(result is not None, "expected a result object") self.assertTrue(type(result) == dict, "expected a dictionary") self.assertTrue('degree' in result, "expected a degree 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'], 'Carnegie-Mellon University', 'expected "Carnegie-Mellon University" instead got %s' % result['name'])
def test_school_success_rpi(self): schoolData = DBProcessing() result = schoolData.getSchoolInfo('rpi') self.assertTrue(result is not None, "expected a result object") self.assertTrue(type(result) == dict, "expected a dictionary") self.assertTrue('degree' in result, "expected a degree 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'], 'Rensselaer Polytechnic Institute', 'expected "Rensselaer Polytechnic Institute" instead got %s' % result['name'])
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'])
def getCompanyInfo(companyname): companyData = DBProcessing() return dumps(companyData.getCompanyInfo(companyname))
def getSchoolInfo(schoolname): schoolData = DBProcessing() return dumps(schoolData.getSchoolInfo(schoolname))