def test_gis_none_string(self): """Tests the response to a GIS request with a list of wrong typed items. """ items = [1, 2, 3] with self.assertRaises(RemotingException): metadata_protocol.write_get_items(items)
def test_gis_none_string(self): """Tests the response to a GIS request with a list of wrong typed items. """ items = [1, 2, 3] with self.assertRaises(RemotingException): metadata_protocol.write_get_items(items)
def execute(): try: items = self._adapter.get_items(user, session_id, group) if not items: METADATA_LOGGER.warning(("None or empty field list from " "get_items for group '%s'"), group) except Exception as err: res = meta_protocol.write_get_items(exception=err) else: res = meta_protocol.write_get_items(items) return res
def execute(): try: items = self._adapter.get_items(user, session_id, group) if not items: METADATA_LOGGER.warning(("None or empty field list from " "get_items for group '%s'"), group) except Exception as err: res = meta_protocol.write_get_items(exception=err) else: res = meta_protocol.write_get_items(items) return res
def test_gis_tobe_quoted_from_bytes(self): """Tests the response to a GIS request with a single item whose name is expressed as a byte string. """ items = [b'a long item name'] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|a+long+item+name", res)
def test_gis_tobe_quoted_symbol(self): """Tests the response to a GIS request with a single item whose name contains the symbol '£'. """ items = ["A symbol to encode £"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|A+symbol+to+encode+%C2%A3", res)
def test_gis_to_be_quoted_spaces(self): """Tests the response to a GIS request with a single item whose name is space separated. """ items = ["a long item name"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|a+long+item+name", res)
def test_gis_tobe_quoted_from_bytes(self): """Tests the response to a GIS request with a single item whose name is expressed as a byte string. """ items = [b'a long item name'] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|a+long+item+name", res)
def test_gis_tobe_quoted_symbol(self): """Tests the response to a GIS request with a single item whose name contains the symbol '£'. """ items = ["A symbol to encode £"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|A+symbol+to+encode+%C2%A3", res)
def test_gis_to_be_quoted_spaces(self): """Tests the response to a GIS request with a single item whose name is space separated. """ items = ["a long item name"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|a+long+item+name", res)
def test_gis_items_error(self): """Tests the response to a GIS request in case of an ItemsError.""" error = ItemsError("Items Error") res = metadata_protocol.write_get_items(exception=error) self.assertEqual("GIS|EI|Items+Error", res)
def test_gis_more(self): """Tests the response to a GIS request with a more than only one item. """ items = ["item1", "item2"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|item1|S|item2", res)
def test_gis_one(self): """Tests the response to a GIS request with a single item.""" items = ["item1"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|item1", res)
def test_gis_none(self): """Tests the response to a GIS request with a None list of items.""" items = None res = metadata_protocol.write_get_items(items) self.assertEqual("GIS", res)
def test_gis_items_error(self): """Tests the response to a GIS request in case of an ItemsError.""" error = ItemsError("Items Error") res = metadata_protocol.write_get_items(exception=error) self.assertEqual("GIS|EI|Items+Error", res)
def test_gis_none(self): """Tests the response to a GIS request with a None list of items.""" items = None res = metadata_protocol.write_get_items(items) self.assertEqual("GIS", res)
def test_gis_more(self): """Tests the response to a GIS request with a more than only one item. """ items = ["item1", "item2"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|item1|S|item2", res)
def test_gis_one(self): """Tests the response to a GIS request with a single item.""" items = ["item1"] res = metadata_protocol.write_get_items(items) self.assertEqual("GIS|S|item1", res)
def test_gis_generic_exception(self): """Tests the response to a GIS request in case of a generic exception. """ error = RuntimeError("Generic Error") res = metadata_protocol.write_get_items(exception=error) self.assertEqual("GIS|E|Generic+Error", res)
def test_gis_generic_exception(self): """Tests the response to a GIS request in case of a generic exception. """ error = RuntimeError("Generic Error") res = metadata_protocol.write_get_items(exception=error) self.assertEqual("GIS|E|Generic+Error", res)