def testInitFromFileWithNoOptionalParameters(self): with open(os.path.join(getDataPath(), "sample.yaml"), 'r') as f: params = yaml.load(f) params.pop("Couples") params.pop("No_match") with patch('pycret_santa.config.open', mock_open(read_data=yaml.dump(params)), create=True) as m: self.ssp.initFromFile("dummy")
def main(): if len(sys.argv) == 2: secretSanta = SecretSantaFactory().getFromConfigFile(sys.argv[1]) else: with open(os.path.join(getDataPath(), "sample.yaml"), 'r') as f: print "Usage: secretsanta [<path_to_config_file>]" print "Content of your config file should look like this:" print "--------" print f.read() print "--------" sys.exit(1) secretSanta.run()
def testInitFromFile(self): self.ssp.initFromFile(os.path.join(getDataPath(), "sample.yaml"))