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)
コード例 #2
0
 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)
コード例 #3
0
 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
コード例 #4
0
 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
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
 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)
コード例 #12
0
 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)
コード例 #13
0
 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)
コード例 #14
0
 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)
コード例 #15
0
 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)
コード例 #19
0
 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)