Ejemplo n.º 1
0
 def test_location_mapping(self):
     '''
     Simple check that the location field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'location': 'USA'}
     self.assertEqual(
         'USA', users.get_profile_field_to_func_map()['location'](row))
Ejemplo n.º 2
0
 def test_birth_date_mapping(self):
     '''
     Simple check that the birth_date field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'year_of_birth': '1984'}
     self.assertEqual(
         '1984', users.get_profile_field_to_func_map()['birth_date'](row))
Ejemplo n.º 3
0
 def test_language_mapping(self):
     '''
     Simple check that the language field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'language': 'en'}
     self.assertEqual(
         'en', users.get_profile_field_to_func_map()['language'](row))
Ejemplo n.º 4
0
 def test_id_mapping(self):
     '''
     Simple check that the _id field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'id': 'abc'}
     self.assertEqual('abc',
                      users.get_profile_field_to_func_map()['_id'](row))
Ejemplo n.º 5
0
 def test_country_mapping(self):
     '''
     Simple check that the country field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'country': 'South Korea'}
     self.assertEqual('South Korea',
                      users.get_profile_field_to_func_map()['country'](row))
Ejemplo n.º 6
0
 def test_gender_mapping(self):
     '''
     Simple check that the gender field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'gender': 'm'}
     self.assertEqual('m',
                      users.get_profile_field_to_func_map()['gender'](row))
Ejemplo n.º 7
0
 def test_bio_mapping(self):
     '''
     Simple check that the bio field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'goals': 'My goal is to finish my thesis and graduate on time.'}
     self.assertEqual(
         'My goal is to finish my thesis and graduate on time.',
         users.get_profile_field_to_func_map()['bio'](row))
Ejemplo n.º 8
0
 def test_education_level_mapping(self):
     '''
     Simple check that the education_level field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'level_of_education': 'p_oth'}
     self.assertEqual(
         'p_oth',
         users.get_profile_field_to_func_map()['education_level'](row))
Ejemplo n.º 9
0
 def test_name_mapping(self):
     '''
     Simple check that the name field in the vismooc
     users schema is mapped to correctly.
     '''
     row = {'name': 'John Doe'}
     self.assertEqual(
         hashlib.new('ripemd160', 'John Doe').hexdigest(),
         users.get_profile_field_to_func_map()['name'](row))