def setUp(self): self.skills = rs_tracker_lambda.get_skills() self.hiscores_data = rs_tracker_lambda.get_raw_hiscores_data( 'woofythedog') self.generator = rs_tracker_lambda.generate_dict_entries( self.hiscores_data, self.skills) self.counter = 0
def test_lynx_titan(self): # Lynx Titan has maxed out stats, so these values won't ever change. data = rs_tracker_lambda.get_raw_hiscores_data('Lynx Titan') self.assertEqual(data[0:24], [ '1,2277,4600000000', '15,99,200000000', '27,99,200000000', '18,99,200000000', '7,99,200000000', '7,99,200000000', '11,99,200000000', '32,99,200000000', '158,99,200000000', '15,99,200000000', '12,99,200000000', '9,99,200000000', '49,99,200000000', '4,99,200000000', '3,99,200000000', '25,99,200000000', '5,99,200000000', '24,99,200000000', '12,99,200000000', '2,99,200000000', '19,99,200000000', '7,99,200000000', '4,99,200000000', '4,99,200000000' ])
def test_length_check_with_hyphens(self): data = rs_tracker_lambda.get_raw_hiscores_data('woofy-dog_-') self.assertEqual(data, None)
def test_empty_username(self): with self.assertRaises(ValueError): rs_tracker_lambda.get_raw_hiscores_data('')
def test_valid_length(self): data = rs_tracker_lambda.get_raw_hiscores_data('disis12chars') self.assertEqual(data, None)
def test_invalid_length(self): with self.assertRaises(ValueError): rs_tracker_lambda.get_raw_hiscores_data('thisis13chars')
def test_invalid_username_with_escape_string(self): with self.assertRaises(ValueError): rs_tracker_lambda.get_raw_hiscores_data('\nhellothe')
def test_invalid_username_with_non_alphanumeric_chars(self): with self.assertRaises(ValueError): rs_tracker_lambda.get_raw_hiscores_data('hello:there:')
def test_bad_username(self): data = rs_tracker_lambda.get_raw_hiscores_data('theoldnite') self.assertEqual(data, None)
def test_get_raw_hs_data(self): data = rs_tracker_lambda.get_raw_hiscores_data('woofythedog') self.assertEqual(len(data), 35) self.assertEqual(type(data), list)