示例#1
0
 def test_store(self):
     mock = MockDevice()
     mock.store('local-path', 'remote-path')
     self.assertIn(
         ' '.join(
             mock.get_ssh_cmd(['scp', 'local-path', '[::1]:remote-path'])),
         mock.history)
示例#2
0
 def test_store(self):
   mock = MockDevice()
   mock.store(tempfile.gettempdir(), 'remote-path')
   self.assertIn(' '.join(
       mock.get_ssh_cmd(['scp',
                         tempfile.gettempdir(), '[::1]:remote-path'])),
                 mock.history)
   # Ensure globbing works
   mock.history = []
   with tempfile.NamedTemporaryFile() as f:
     mock.store('{}/*'.format(tempfile.gettempdir()), 'remote-path')
     for cmd in mock.history:
       if cmd.startswith('scp'):
         self.assertIn(f.name, cmd)
示例#3
0
 def test_store(self):
   mock = MockDevice()
   mock.store('local-path', 'remote-path')
   self.assertEqual(
       mock.last,
       'scp -F ' + mock.host.ssh_config + ' local-path [::1]:remote-path')