Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 3
0
 def test_roundtrip_from_string(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = text_type(block_type)
     self.assertEqual(key, serialized)
Ejemplo n.º 4
0
 def test_deprecated_roundtrip(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = str(block_type)
     self.assertEqual(key, serialized)
Ejemplo n.º 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)
Ejemplo n.º 6
0
 def test_roundtrip_from_string(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = unicode(block_type)
     self.assertEqual(key, serialized)
Ejemplo n.º 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)
Ejemplo n.º 8
0
 def test_deprecated_roundtrip(self, key):
     block_type = BlockTypeKey.from_string(key)
     serialized = text_type(block_type)
     self.assertEqual(key, serialized)