Exemple #1
0
 def testCanonical(self):
     
     src = "/tmp/d2c.test/collect_src"
     dest = "/tmp/d2c.test/collect_dest/%d" % random.randint(0,100)
     
     
     if not os.path.exists(os.path.dirname(src)):
         os.mkdir(os.path.dirname(src))
         
     open(src, 'a').close()
          
     instance = mock(Instance)
     instance.key_name = "dummyKey"
     instance.public_dns_name = 'localhost'
     
     sshCred = SSHCred("willmore", "/home/willmore/.ssh/id_rsa_nopw")
     collector = DataCollector(src, sshCred)
     collector.collect(instance)
     
     self.assertTrue(os.path.exists(dest))