Ejemplo n.º 1
0
def test_IP21_init_odbc_client_with_host_port():
    host = "thehostname"
    port = 999
    c = IMSClient(datasource="whatever", imstype="ip21", host=host)
    assert c.handler.host == host
    assert c.handler.port == 10014
    c = IMSClient(datasource="whatever", imstype="ip21", host=host, port=port)
    assert c.handler.host == host
    assert c.handler.port == port
Ejemplo n.º 2
0
 def test_PI_init_odbc_client_with_host_port(self):
     host = "thehostname"
     port = 999
     c = IMSClient(datasource="whatever", imstype="pi", host=host)
     assert c.handler.host == host
     assert c.handler.port == 5450
     c = IMSClient(datasource="whatever",
                   imstype="pi",
                   host=host,
                   port=port)
     assert c.handler.host == host
     assert c.handler.port == port
Ejemplo n.º 3
0
def Client():
    c = IMSClient(SOURCE, "pi")
    c.cache = None
    c.connect()
    yield c
    if os.path.exists(SOURCE + ".h5"):
        os.remove(SOURCE + ".h5")
def Client():
    c = IMSClient(SOURCE, imstype="aspenone", verifySSL=verifySSL)
    c.cache = None
    c.connect()
    yield c
    if os.path.exists(SOURCE + ".h5"):
        os.remove(SOURCE + ".h5")
def Client():
    c = IMSClient(SOURCE, imstype="piwebapi", verifySSL=verifySSL)
    c.cache = None
    c.connect()
    c.handler._max_rows = 1000  # For the long raw test
    yield c
    if os.path.exists(SOURCE + ".h5"):
        os.remove(SOURCE + ".h5")
Ejemplo n.º 6
0
 def test_IP21_connection_string_override(self):
     connstr = "someuserspecifiedconnectionstring"
     c = IMSClient(
         datasource="whatever",
         host="host",
         imstype="ip21",
         handler_options={"connection_string": connstr},
     )
     assert c.handler.generate_connection_string() == connstr
Ejemplo n.º 7
0
 def test_init_odbc_clients(self):
     with pytest.raises(ValueError):
         c = IMSClient("xyz")
     with pytest.raises(ValueError):
         c = IMSClient("sNa", "pi")
     with pytest.raises(ValueError):
         c = IMSClient("Ono-imS", "aspen")
     with pytest.raises(ValueError):
         c = IMSClient("ono-ims", "aspen")
     with pytest.raises(ValueError):
         c = IMSClient("sna", "pi")
     c = IMSClient("onO-iMs", "pi")
     assert isinstance(c.handler, PIHandlerODBC)
     c = IMSClient("snA", "aspen")
     assert isinstance(c.handler, AspenHandlerODBC)