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 97 of file IOVDbAutoCfgFlags.py.

Member Function Documentation

◆ test_empty()

python.IOVDbAutoCfgFlags.Test.test_empty ( self)

Definition at line 105 of file IOVDbAutoCfgFlags.py.

105 def test_empty(self):
106 self.assertEqual(getCrestServer(), "https://crest.cern.ch")
107 self.assertEqual(getCrestConnection(), "https://crest.cern.ch/" + getCrestAPI())
108

◆ test_file_exists()

python.IOVDbAutoCfgFlags.Test.test_file_exists ( self)

Definition at line 123 of file IOVDbAutoCfgFlags.py.

123 def test_file_exists(self):
124 with tempfile.NamedTemporaryFile() as f:
125 self.assertEqual(getCrestConnection(f.name), f.name)
126
127 unittest.main()

◆ test_file_nonexistent()

python.IOVDbAutoCfgFlags.Test.test_file_nonexistent ( self)

Definition at line 119 of file IOVDbAutoCfgFlags.py.

119 def test_file_nonexistent(self):
120 with self.assertRaises(RuntimeError):
121 getCrestConnection("mydb.txt")
122

◆ test_no_envvar()

python.IOVDbAutoCfgFlags.Test.test_no_envvar ( self)

Definition at line 99 of file IOVDbAutoCfgFlags.py.

99 def test_no_envvar(self):
100 with patch.dict(os.environ):
101 os.environ.pop("CREST_SERVER", None)
102 self.assertEqual(getCrestServer(), "https://crest.cern.ch")
103

◆ test_no_protocol()

python.IOVDbAutoCfgFlags.Test.test_no_protocol ( self)

Definition at line 110 of file IOVDbAutoCfgFlags.py.

110 def test_no_protocol(self):
111 self.assertEqual(getCrestServer(), "https://myserver.com")
112 self.assertEqual(getCrestConnection(), "https://myserver.com/" + getCrestAPI())
113

◆ test_with_protocol()

python.IOVDbAutoCfgFlags.Test.test_with_protocol ( self)

Definition at line 115 of file IOVDbAutoCfgFlags.py.

115 def test_with_protocol(self):
116 self.assertEqual(getCrestServer(), "http://myserver.com/")
117 self.assertEqual(getCrestConnection(), "http://myserver.com/" + getCrestAPI())
118

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