Exemplo n.º 1
0
def h2oset_timezone():
    """
    Python API test: h2o.set_timezone(value)
    Deprecated, set h2o.cluster().timezone instead.

    Copy from pyunit_get_set_list_timezones.py
    """
    try:
        origTZ = h2o.get_timezone()
        print("Original timezone: {0}".format(origTZ))

        timezones = h2o.list_timezones()
        # don't use the first one..it's a header for the table
        print("timezones[0]:", timezones[0])
        zone = timezones[random.randint(1, timezones.nrow - 1),
                         0].split(" ")[1].split(",")[0]
        print("Setting the timezone: {0}".format(zone))
        h2o.set_timezone(zone)

        newTZ = h2o.get_timezone()
        assert newTZ == zone, "Expected new timezone to be {0}, but got {01}".format(
            zone, newTZ)

        print("Setting the timezone back to original: {0}".format(origTZ))
        h2o.set_timezone(origTZ)
    except Exception as e:
        assert False, "h2o.set_timezone() command is not working."
def h2olist_timezones():
    """
    Python API test: h2o.list_timezones()
    Deprecated, use h2o.cluster().list_timezones().
    """
    timezones = h2o.list_timezones()
    assert_is_type(timezones, H2OFrame)
    assert timezones.nrow == 460, "h2o.get_timezone() returns frame with wrong row number."
    assert timezones.ncol == 1, "h2o.get_timezone() returns frame with wrong column number."
def h2olist_timezones():
    """
    Python API test: h2o.list_timezones()
    Deprecated, use h2o.cluster().list_timezones().
    """
    timezones = h2o.list_timezones()
    assert_is_type(timezones, H2OFrame)
    assert timezones.nrow==468, "h2o.get_timezone() returns frame with wrong row number."
    assert timezones.ncol==1, "h2o.get_timezone() returns frame with wrong column number."
Exemplo n.º 4
0
def h2olist_timezones():
    """
    Python API test: h2o.list_timezones()
    Deprecated, use h2o.cluster().list_timezones().
    """
    try:
        timezones = h2o.list_timezones()
        assert_is_type(timezones, H2OFrame)
        assert timezones.nrow==460, "h2o.get_timezone() returns frame with wrong row number."
        assert timezones.ncol==1, "h2o.get_timezone() returns frame with wrong column number."
    except Exception as e:
        assert False, "h2o.list_timezones() command is not working."
def h2oget_timezone():
    """
    Python API test: h2o.get_timezone()
    Deprecated, use h2o.cluster().timezone.

    Copy from pyunit_get_set_list_timezones.py
    """
    origTZ = h2o.get_timezone()
    print("Original timezone: {0}".format(origTZ))

    timezones = h2o.list_timezones()
    assert_is_type(timezones, H2OFrame)
    assert timezones.nrow == 468, "h2o.get_timezone() returns frame with wrong row number."
    assert timezones.ncol == 1, "h2o.get_timezone() returns frame with wrong column number."
Exemplo n.º 6
0
def h2oget_timezone():
    """
    Python API test: h2o.get_timezone()
    Deprecated, use h2o.cluster().timezone.

    Copy from pyunit_get_set_list_timezones.py
    """
    try:
        origTZ = h2o.get_timezone()
        print("Original timezone: {0}".format(origTZ))

        timezones = h2o.list_timezones()
        assert_is_type(timezones, H2OFrame)
        assert timezones.nrow == 460, "h2o.get_timezone() returns frame with wrong row number."
        assert timezones.ncol == 1, "h2o.get_timezone() returns frame with wrong column number."
    except Exception as e:
        assert False, "h2o.get_timezone() command is not working."
Exemplo n.º 7
0
def get_set_list_timezones(ip,port):
    # Connect to h2o
    h2o.init(ip,port)

    origTZ = h2o.get_timezone()
    print "Original timezone: {0}".format(origTZ)

    timezones = h2o.list_timezones()
    zone = timezones[random.randint(0,timezones.nrow()-1),0].split(" ")[1].split(",")[0]
    print "Setting the timezone: {0}".format(zone)
    h2o.set_timezone(zone)

    newTZ = h2o.get_timezone()
    assert newTZ == zone, "Expected new timezone to be {0}, but got {01}".format(zone, newTZ)

    print "Setting the timezone back to original: {0}".format(origTZ)
    h2o.set_timezone(origTZ)
def get_set_list_timezones():
    
    

    origTZ = h2o.get_timezone()
    print "Original timezone: {0}".format(origTZ)

    timezones = h2o.list_timezones()
    # don't use the first one..it's a header for the table
    print "timezones[0]:", timezones[0]
    zone = timezones[random.randint(1,timezones.nrow-1),0].split(" ")[1].split(",")[0]
    print "Setting the timezone: {0}".format(zone)
    h2o.set_timezone(zone)

    newTZ = h2o.get_timezone()
    assert newTZ == zone, "Expected new timezone to be {0}, but got {01}".format(zone, newTZ)

    print "Setting the timezone back to original: {0}".format(origTZ)
    h2o.set_timezone(origTZ)
def get_set_list_timezones():

    origTZ = h2o.get_timezone()
    print "Original timezone: {0}".format(origTZ)

    timezones = h2o.list_timezones()
    # don't use the first one..it's a header for the table
    print "timezones[0]:", timezones[0]
    zone = timezones[random.randint(1, timezones.nrow - 1),
                     0].split(" ")[1].split(",")[0]
    print "Setting the timezone: {0}".format(zone)
    h2o.set_timezone(zone)

    newTZ = h2o.get_timezone()
    assert newTZ == zone, "Expected new timezone to be {0}, but got {01}".format(
        zone, newTZ)

    print "Setting the timezone back to original: {0}".format(origTZ)
    h2o.set_timezone(origTZ)
def h2oset_timezone():
    """
    Python API test: h2o.set_timezone(value)
    Deprecated, set h2o.cluster().timezone instead.

    Copy from pyunit_get_set_list_timezones.py
    """
    origTZ = h2o.get_timezone()
    print("Original timezone: {0}".format(origTZ))

    timezones = h2o.list_timezones()
    # don't use the first one..it's a header for the table
    print("timezones[0]:", timezones[0])
    zone = timezones[random.randint(1,timezones.nrow-1),0].split(" ")[1].split(",")[0]
    print("Setting the timezone: {0}".format(zone))
    h2o.set_timezone(zone)

    newTZ = h2o.get_timezone()
    assert newTZ == zone, "Expected new timezone to be {0}, but got {01}".format(zone, newTZ)

    print("Setting the timezone back to original: {0}".format(origTZ))
    h2o.set_timezone(origTZ)