test_create_new_vm.py 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/usr/bin/python3
  2. #
  3. # The Qubes OS Project, https://www.qubes-os.org/
  4. #
  5. # Copyright (C) 2016 Marta Marczykowska-Górecka
  6. # <marmarta@invisiblethingslab.com>
  7. #
  8. # This program is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License along
  19. # with this program; if not, write to the Free Software Foundation, Inc.,
  20. # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  21. #
  22. import logging.handlers
  23. import sys
  24. import unittest
  25. import unittest.mock
  26. from PyQt4 import QtGui, QtTest, QtCore
  27. from qubesadmin import Qubes, events, utils, exc
  28. from qubesmanager import create_new_vm
  29. class NewVmTest(unittest.TestCase):
  30. def setUp(self):
  31. super(NewVmTest, self).setUp()
  32. self.qapp = Qubes()
  33. self.qtapp = QtGui.QApplication(sys.argv)
  34. self.dispatcher = events.EventsDispatcher(self.qapp)
  35. self.dialog = create_new_vm.NewVmDlg(
  36. self.qtapp, self.qapp)
  37. def tearDown(self):
  38. self.dialog.deleteLater()
  39. super(NewVmTest, self).tearDown()
  40. def test_00_window_loads(self):
  41. self.assertTrue(self.dialog.select_vms_widget is not None)
  42. def test_01_vms_load_correctly(self):
  43. pass
  44. class CreatteVMThreadTest(unittest.TestCase):
  45. if __name__ == "__main__":
  46. ha_syslog = logging.handlers.SysLogHandler('/dev/log')
  47. ha_syslog.setFormatter(
  48. logging.Formatter('%(name)s[%(process)d]: %(message)s'))
  49. logging.root.addHandler(ha_syslog)
  50. unittest.main()