

def test_add_master_nodes_in_virt_deployment(self):
    ips_yaml = '\nmaster: 1.2.3.4\ndatabase: 1.2.3.4\nzookeeper: 1.2.3.4\nappengine: 1.2.3.4\n    '
    fake_yaml_file = flexmock(name='fake_yaml')
    fake_yaml_file.should_receive('read').and_return(ips_yaml)
    builtins = flexmock(sys.modules['__builtin__'])
    builtins.should_call('open')
    builtins.should_receive('open').with_args('/tmp/boo.yaml', 'r').and_return(fake_yaml_file)
    argv = ['--ips', '/tmp/boo.yaml', '--keyname', self.keyname]
    options = ParseArgs(argv, self.function).args
    self.assertRaises(BadConfigurationException, AppScaleTools.add_instances, options)

dataset/ETHPy150Open AppScale/appscale-tools/test/test_appscale_add_instances.py TestAppScaleAddInstances.test_add_master_nodes_in_virt_deployment/original