Ejemplo n.º 1
0
 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")
Ejemplo n.º 2
0
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()
Ejemplo n.º 3
0
 def testInitFromFile(self):
   self.ssp.initFromFile(os.path.join(getDataPath(), "sample.yaml"))