ATLAS Offline Software
Loading...
Searching...
No Matches
python.IOVDbAutoCfgFlags.Test Class Reference
Inheritance diagram for python.IOVDbAutoCfgFlags.Test:
Collaboration diagram for python.IOVDbAutoCfgFlags.Test:

Public Member Functions

 test_no_envvar (self)
 test_empty (self)
 test_no_protocol (self)
 test_with_protocol (self)
 test_file_nonexistent (self)
 test_file_exists (self)

Detailed Description

Definition at line 89 of file IOVDbAutoCfgFlags.py.

Member Function Documentation

◆ test_empty()

python.IOVDbAutoCfgFlags.Test.test_empty ( self)

Definition at line 97 of file IOVDbAutoCfgFlags.py.

97 def test_empty(self):
98 self.assertEqual(getCrestServer(), "https://crest.cern.ch")
99 self.assertEqual(getCrestConnection(), "https://crest.cern.ch/" + getCrestAPI())
100

◆ test_file_exists()

python.IOVDbAutoCfgFlags.Test.test_file_exists ( self)

Definition at line 115 of file IOVDbAutoCfgFlags.py.

115 def test_file_exists(self):
116 with tempfile.NamedTemporaryFile() as f:
117 self.assertEqual(getCrestConnection(f.name), f.name)
118
119 unittest.main()

◆ test_file_nonexistent()

python.IOVDbAutoCfgFlags.Test.test_file_nonexistent ( self)

Definition at line 111 of file IOVDbAutoCfgFlags.py.

111 def test_file_nonexistent(self):
112 with self.assertRaises(RuntimeError):
113 getCrestConnection("mydb.txt")
114

◆ test_no_envvar()

python.IOVDbAutoCfgFlags.Test.test_no_envvar ( self)

Definition at line 91 of file IOVDbAutoCfgFlags.py.

91 def test_no_envvar(self):
92 with patch.dict(os.environ):
93 os.environ.pop("CREST_SERVER", None)
94 self.assertEqual(getCrestServer(), "https://crest.cern.ch")
95

◆ test_no_protocol()

python.IOVDbAutoCfgFlags.Test.test_no_protocol ( self)

Definition at line 102 of file IOVDbAutoCfgFlags.py.

102 def test_no_protocol(self):
103 self.assertEqual(getCrestServer(), "https://myserver.com")
104 self.assertEqual(getCrestConnection(), "https://myserver.com/" + getCrestAPI())
105

◆ test_with_protocol()

python.IOVDbAutoCfgFlags.Test.test_with_protocol ( self)

Definition at line 107 of file IOVDbAutoCfgFlags.py.

107 def test_with_protocol(self):
108 self.assertEqual(getCrestServer(), "http://myserver.com/")
109 self.assertEqual(getCrestConnection(), "http://myserver.com/" + getCrestAPI())
110

The documentation for this class was generated from the following file: