def test_ntp_conf_without_options(): ntp_conf = NTP_CONF_STANZA for n in range(0, 3): s = "{}.pool.ntp.org".format(n) ntp_conf += "server {} iburst\n".format(s.lower()) eq_(screenly_net_mgr.generate_ntp_conf(), ntp_conf)
def test_ntp_conf_without_options(): ntp_conf = NTP_CONF_STANZA for n in range(0, 3): s = '{}.pool.ntp.org'.format(n) ntp_conf += 'server {} iburst\n'.format(s.lower()) eq_(screenly_net_mgr.generate_ntp_conf(), ntp_conf)
def test_ntp_conf_with_two_option(): servers = ["1.1.1.1", "2.2.2.2"] ntp_conf = NTP_CONF_STANZA for n in servers: ntp_conf += "server {} iburst\n".format(n) eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)
def test_ntp_conf_with_two_option(): servers = ['1.1.1.1', '2.2.2.2'] ntp_conf = NTP_CONF_STANZA for n in servers: ntp_conf += 'server {} iburst\n'.format(n) eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)
def test_ntp_conf_with_invalid_option(): eq_(screenly_net_mgr.generate_ntp_conf(ntpservers="foobar"), False)
def test_ntp_conf_with_one_option(): servers = ["1.2.3.4"] ntp_conf = NTP_CONF_STANZA ntp_conf += "server {} iburst\n".format(servers[0]) eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)
def test_ntp_conf_with_invalid_option(): eq_(screenly_net_mgr.generate_ntp_conf(ntpservers='foobar'), False)
def test_ntp_conf_with_one_option(): servers = ['1.2.3.4'] ntp_conf = NTP_CONF_STANZA ntp_conf += 'server {} iburst\n'.format(servers[0]) eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)