test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
testing_classes.querying_tests Class Reference
Inheritance diagram for testing_classes.querying_tests:

Public Member Functions

def setUp
 
def tearDown
 
def test_check_connection
 
def test_factory_empty_result
 
def test_factory_multiple_results
 
def test_factory_no_result
 
def test_factory_single_result
 
def test_get_empty_payload
 
def test_get_empty_tag
 
def test_get_global_tag
 
def test_get_parent_global_tags
 
def test_get_parent_tags_payload
 
def test_get_payload
 
def test_get_tag
 
def test_search_everything
 
def tests_all_global_tags_empty_gt
 
def tests_all_tags_empty_tag
 
def tests_all_tags_non_empty_tag
 

Public Attributes

 connection
 

Detailed Description

Definition at line 25 of file testing_classes.py.

Member Function Documentation

def testing_classes.querying_tests.setUp (   self)

Definition at line 27 of file testing_classes.py.

27 
28  def setUp(self):
29  connection_data = {"db_alias" : "orapro", "host" : "oracle", "schema" : "cms_conditions", "secrets" : secrets_file}
30  self.connection = querying.connect(connection_data)
def connect
Definition: querying.py:352
def testing_classes.querying_tests.tearDown (   self)

Definition at line 128 of file testing_classes.py.

129  def tearDown(self):
130  self.connection.close_session()
def testing_classes.querying_tests.test_check_connection (   self)

Definition at line 31 of file testing_classes.py.

References querying.connection.connection, testing_classes.querying_tests.connection, and querying.factory.connection.

31 
32  def test_check_connection(self):
33  self.assertTrue(self.connection != None)
def testing_classes.querying_tests.test_factory_empty_result (   self)

Definition at line 120 of file testing_classes.py.

121  def test_factory_empty_result(self):
122  tag = self.connection.tag()
123  self.assertTrue(tag.empty)
def testing_classes.querying_tests.test_factory_multiple_results (   self)

Definition at line 112 of file testing_classes.py.

114  tags = self.connection.tag(time_type="Run")
115  self.assertTrue(len(tags.data()) > 1)
def testing_classes.querying_tests.test_factory_no_result (   self)

Definition at line 124 of file testing_classes.py.

125  def test_factory_no_result(self):
126  tag = self.connection.tag(name="dfasdf")
127  self.assertTrue(tag == None)
def testing_classes.querying_tests.test_factory_single_result (   self)

Definition at line 116 of file testing_classes.py.

117  def test_factory_single_result(self):
118  tag = self.connection.tag(name="EBAlignment_hlt")
119  self.assertEqual(tag.__class__.__name__.lower(), "tag")
def testing_classes.querying_tests.test_get_empty_payload (   self)

Definition at line 65 of file testing_classes.py.

65 
66  def test_get_empty_payload(self):
67  payload = self.connection.payload()
68  self.assertTrue(payload != None)
69  self.assertEqual(payload.__class__.__name__.lower(), "payload")
def testing_classes.querying_tests.test_get_empty_tag (   self)

Definition at line 44 of file testing_classes.py.

44 
45  def test_get_empty_tag(self):
46  tag = self.connection.tag()
47  self.assertTrue(tag != None)
48  self.assertEqual(tag.__class__.__name__.lower(), "tag")
def testing_classes.querying_tests.test_get_global_tag (   self)

Definition at line 49 of file testing_classes.py.

49 
50  def test_get_global_tag(self):
51  # hard coded global tag for now
52  global_tag_name = "74X_dataRun1_HLT_frozen_v2"
53  global_tag = self.connection.global_tag(name=global_tag_name)
54  self.assertTrue(global_tag != None)
55  self.assertTrue(global_tag.name != None)
56  self.assertTrue(global_tag.tags() != None)
57  self.assertEqual(global_tag.__class__.__name__.lower(), "globaltag")
def testing_classes.querying_tests.test_get_parent_global_tags (   self)

Definition at line 77 of file testing_classes.py.

77 
79  tag_name = "EBAlignment_measured_v01_express"
80  tag = self.connection.tag(name=tag_name)
81  self.assertTrue(tag != None)
82  parent_global_tags = tag.parent_global_tags()
83  self.assertTrue(parent_global_tags != None)
def testing_classes.querying_tests.test_get_parent_tags_payload (   self)

Definition at line 70 of file testing_classes.py.

70 
72  payload_hash = "00172cd62d8abae41915978d815ae62cc08ad8b9"
73  payload = self.connection.payload(hash=payload_hash)
74  self.assertTrue(payload != None)
75  parent_tags = payload.parent_tags()
76  self.assertTrue(parent_tags != None)
def testing_classes.querying_tests.test_get_payload (   self)

Definition at line 58 of file testing_classes.py.

58 
59  def test_get_payload(self):
60  # hard coded payload for now
61  payload_hash = "00172cd62d8abae41915978d815ae62cc08ad8b9"
62  payload = self.connection.payload(hash=payload_hash)
63  self.assertTrue(payload != None)
64  self.assertEqual(payload.__class__.__name__.lower(), "payload")
def testing_classes.querying_tests.test_get_tag (   self)

Definition at line 34 of file testing_classes.py.

34 
35  def test_get_tag(self):
36  # hard code tag for now
37  tag_name = "EBAlignment_measured_v01_express"
38  tag = self.connection.tag(name=tag_name)
39  # this tag exists, so shouldn't be NoneType
40  self.assertTrue(tag != None)
41  # we gave the name, so that should at least be in the tag object
42  self.assertTrue(tag.name != None)
43  self.assertEqual(tag.__class__.__name__.lower(), "tag")
def testing_classes.querying_tests.test_search_everything (   self)

Definition at line 105 of file testing_classes.py.

References data.

106  def test_search_everything(self):
107  string_for_non_empty_result = "ecal"
108  data = self.connection.search_everything(string_for_non_empty_result)
109  self.assertTrue(len(data.get("global_tags").data()) != 0)
110  self.assertTrue(len(data.get("tags").data()) != 0)
111  self.assertTrue(len(data.get("payloads").data()) != 0)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def testing_classes.querying_tests.tests_all_global_tags_empty_gt (   self)

Definition at line 99 of file testing_classes.py.

99 
101  empty_gt = self.connection.global_tag()
102  all_gts = empty_gt.all(10)
103  self.assertTrue(all_gts != None)
104  self.assertTrue(len(all_gts.data()) != 0)
def testing_classes.querying_tests.tests_all_tags_empty_tag (   self)

Definition at line 84 of file testing_classes.py.

84 
85  def tests_all_tags_empty_tag(self):
86  empty_tag = self.connection.tag()
87  all_tags = empty_tag.all(10)
88  self.assertTrue(all_tags != None)
89  # there are always tags in the db
90  self.assertTrue(len(all_tags.data()) != 0)
def testing_classes.querying_tests.tests_all_tags_non_empty_tag (   self)

Definition at line 91 of file testing_classes.py.

91 
93  tag_name = "EBAlignment_measured_v01_express"
94  empty_tag = self.connection.tag(name=tag_name)
95  all_tags = empty_tag.all(10)
96  self.assertTrue(all_tags != None)
97  # there are always tags in the db
98  self.assertTrue(len(all_tags.data()) != 0)

Member Data Documentation

testing_classes.querying_tests.connection

Definition at line 29 of file testing_classes.py.

Referenced by testing_classes.querying_tests.test_check_connection(), and testing_classes.data_formats_tests.test_dicts_to_orm_objects().