示例#1
0
    def test_valid_schedule(self):
        config = Config()

        for sched in [
                "every day",
                "every week",
                "every week on monday",
                "every week on tuesday",
                "every week on wednesday",
                "every week on thursday",
                "every week on friday",
                "every week on saturday",
                "every week on sunday",
                "every two weeks",
                "every two weeks on monday",
                "every two weeks on monday",
                "every two weeks on tuesday",
                "every two weeks on wednesday",
                "every two weeks on thursday",
                "every two weeks on friday",
                "every two weeks on saturday",
                "every two weeks on sunday",
                "every month"]:
            config.schedule = sched
            self.assertTrue(config.is_valid_schedule())

        for sched in [
                "every day on monday",
                "every month on tuesday",
                "some other crap",
                "every bla",
                "foo"]:
            config.schedule = sched
            self.assertFalse(config.is_valid_schedule())
示例#2
0
    def test_valid_schedule(self):
        config = Config()

        for sched in [
                "every day",
                "every week",
                "every week on monday",
                "every week on tuesday",
                "every week on wednesday",
                "every week on thursday",
                "every week on friday",
                "every week on saturday",
                "every week on sunday",
                "every two weeks",
                "every two weeks on monday",
                "every two weeks on tuesday",
                "every two weeks on wednesday",
                "every two weeks on thursday",
                "every two weeks on friday",
                "every two weeks on saturday",
                "every two weeks on sunday",
                "every month"]:
            config.schedule = sched
            self.assertTrue(config.is_valid_schedule())

        for sched in [
                "every day on monday",
                "every month on tuesday",
                "some other crap",
                "every bla",
                "foo"]:
            config.schedule = sched
            self.assertFalse(config.is_valid_schedule())
def test_pyup_yml_is_valid():
    with open(tools.PYUP_FILE, "r") as i:
        data = yaml.safe_load(i.read())
    config = Config()
    config.update_config(data)

    assert config.is_valid_schedule(), "Schedule %r is invalid" % (config.schedule,)
示例#4
0
def check_pyup_yml():
    with open(tools.PYUP_FILE, 'r') as i:
        data = yaml.safe_load(i.read())
    config = Config()
    config.update_config(data)

    if not config.is_valid_schedule():
        print('Schedule %r is invalid' % (config.schedule, ))
        sys.exit(1)
示例#5
0
# consult the git log if you need to determine who owns an individual
# contribution.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
#
# END HEADER

from __future__ import division, print_function, absolute_import

import os
import sys

import yaml
from pyup.config import Config

from hypothesistooling import ROOT

PYUP_FILE = os.path.join(ROOT, '.pyup.yml')

if __name__ == '__main__':
    with open(PYUP_FILE, 'r') as i:
        data = yaml.safe_load(i.read())
    config = Config()
    config.update_config(data)

    if not config.is_valid_schedule():
        print('Schedule %r is invalid' % (config.schedule,))
        sys.exit(1)
示例#6
0
# consult the git log if you need to determine who owns an individual
# contribution.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the MPL was not distributed with this file, You can
# obtain one at http://mozilla.org/MPL/2.0/.
#
# END HEADER

from __future__ import division, print_function, absolute_import

import os
import sys

import yaml
from pyup.config import Config

from hypothesistooling import ROOT

PYUP_FILE = os.path.join(ROOT, '.pyup.yml')

if __name__ == '__main__':
    with open(PYUP_FILE, 'r') as i:
        data = yaml.safe_load(i.read())
    config = Config()
    config.update_config(data)

    if not config.is_valid_schedule():
        print('Schedule %r is invalid' % (config.schedule, ))
        sys.exit(1)