예제 #1
0
 def get_by_jnumber(self, jnumber):
     """
     Retrieve a single reference by jnumber (without J: prefix)
     returns SmallReference
     """
     jnum_id = parse_jnumber(jnumber)
     reference = self.get_by_jnum_id(jnum_id)
     return convert_models(reference, SmallReference)
예제 #2
0
 def test_lowercase(self):
     jnumber = parse_jnumber("j:1234")
     expected = "J:1234"
     self.assertEqual(expected, jnumber)
예제 #3
0
 def test_jnumber_without_colon(self):
     jnumber = parse_jnumber("J1234")
     expected = "J:1234"
     self.assertEqual(expected, jnumber)
예제 #4
0
 def test_numeric_value(self):
     jnumber = parse_jnumber("1234")
     expected = "J:1234"
     self.assertEqual(expected, jnumber)
예제 #5
0
 def test_empty_input(self):
     jnumber = parse_jnumber("")
     expected = ""
     self.assertEqual(expected, jnumber)