def setUp(self):
        """
		set up data structure necessary at the begining of every test
		"""
        self.wheel = wheel.Wheel()
        self.wheel.bins = tuple(bin.Bin() for i in range(38))
        self.builder = bin_builder.BinBuilder(self.wheel)
Example #2
0
 def setUp(self):
     _wheel = wheel.Wheel()
     _wheel.rng = Mock()
     _wheel.rng.randint = Mock(return_value=1)
     self.table = table.Table(minimum=1, maximum=1000)
     self.game = roulette_game.RouletteGame(wheel=_wheel, table=self.table)
     self.player = roulette_martingale.RouletteMartingale(wheel=_wheel, table=self.table)
 def setUp(self):
     self.wheel = wheel.Wheel()
     self.table = table.Table(minimum=1, maximum=1000)
     self.game = roulette_game.RouletteGame(table=self.table,
                                            wheel=self.wheel)
     self.player = roulette1326.Roulette1326(wheel=self.wheel,
                                             table=self.table)
     self.bet = bet.Bet(outcome=self.wheel.all_outcomes.get('Black'),
                        amount=10)
 def setUp(self):
     self.wheel = wheel.Wheel()
     self.red = [self.wheel.all_outcomes['Red']]
     self.black = [self.wheel.all_outcomes['Black']]
     self.wheel.rng = Mock()
     self.wheel.rng.randint = Mock(return_value=1)
     self.table = table.Table(minimum=1, maximum=1000)
     self.game = roulette_game.RouletteGame(wheel=self.wheel,
                                            table=self.table)
     self.player = roulette_seven_reds.RouletteSevenReds(
         self.table, self.wheel)
    def setUp(self):
        """
		Sets seed for random number generator of the wheel
		Create outcomes required to test addition of outcomes
		Inititialize a bin to test get method
		"""
        self.wheel = wheel.Wheel()
        # self.wheel.rng.seed(1)
        self.wheel.rng = Mock()
        self.wheel.rng.randint = Mock(return_value=1)
        self.outcome_test = outcome.Outcome("00-test", 35)
 def setUp(self):
     self.wheel = wheel.Wheel()
     self.table = table.Table(minimum=1, maximum=1000)
     self.game = roulette_game.RouletteGame(table=self.table,
                                            wheel=self.wheel)
     self.bets = [
         bet.Bet(5, outcome.Outcome("Number 1", 35)),
         bet.Bet(20, outcome.Outcome("Number 2", 35)),
         bet.Bet(50, outcome.Outcome("Number 3", 35)),
         bet.Bet(490, outcome.Outcome("Number 4", 35))
     ]
Example #7
0
def main():
    parser = argparse.ArgumentParser(
        description="Resolve and fetch artifacts transitively from PyPI"
    )
    parser.add_argument(
        "--requirements",
        action="store",
        help="Path to requirements.txt from where to install dependencies",
    )
    parser.add_argument(
        "--repo",
        action="store",
        help="The external repo name to install dependencies.",
    )
    args = parser.parse_args()

    # Assumes any errors are logged by pip so do nothing. This command will fail if pip fails
    subprocess.check_output(
        [sys.executable, "-m", "pip", "wheel", "-r", args.requirements]
    )

    targets = set()

    for whl in [wheel.Wheel(whl) for whl in glob.glob("*.whl")]:
        whl_label = sanitise_name(whl.name())
        os.mkdir(whl_label)
        extract_wheel(whl, whl_label, [])
        targets.add('"{repo}//{name}"'.format(repo=args.repo, name=whl_label))
        os.remove(whl.path())

    with open("requirements.bzl", "w") as f:
        f.write(
            """\
all_requirements = [{requirement_labels}]

def requirement(name):
    name_key = name.replace("-", "_").replace(".", "_").lower()
    return "{repo}//pypi__" + name_key
""".format(
                requirement_labels=",".join(sorted(targets)), repo=args.repo
            )
        )
 def setUp(self):
     self.wheel = wheel.Wheel()
     self.wheel.bins = tuple(bin.Bin() for i in range(38))
     self.Director = bin_builder.WheelDirector()