예제 #1
0
 def test_roundtrip_from_key(self, family, block_type):
     key = BlockTypeKeyV1(family, block_type)
     serialized = text_type(key)
     deserialized = BlockTypeKey.from_string(serialized)
     self.assertEqual(key, deserialized)
예제 #2
0
 def test_parse_deprecated_type(self, key):
     block_type = BlockTypeKey.from_string(key)
     self.assertEqual(key, block_type.block_type)
     self.assertEqual('xblock.v1', block_type.block_family)
예제 #3
0
 def test_roundtrip_from_string(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = text_type(block_type)
     self.assertEqual(key, serialized)
예제 #4
0
 def test_deprecated_roundtrip(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = str(block_type)
     self.assertEqual(key, serialized)
예제 #5
0
 def test_roundtrip_from_key(self, family, block_type):
     key = BlockTypeKeyV1(family, block_type)
     serialized = unicode(key)
     deserialized = BlockTypeKey.from_string(serialized)
     self.assertEqual(key, deserialized)
예제 #6
0
 def test_roundtrip_from_string(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = unicode(block_type)
     self.assertEqual(key, serialized)
예제 #7
0
 def test_parse_deprecated_type(self, key):
     block_type = BlockTypeKey.from_string(key)
     self.assertEqual(key, block_type.block_type)
     self.assertEqual('xblock.v1', block_type.block_family)
예제 #8
0
 def test_deprecated_roundtrip(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = text_type(block_type)
     self.assertEqual(key, serialized)