test_architecture.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # This program is free software; you can redistribute it and/or modify
  2. # it under the terms of the GNU General Public License as published by
  3. # the Free Software Foundation; either version 2 of the License, or
  4. # (at your option) any later version.
  5. # This program is distributed in the hope that it will be useful,
  6. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. # GNU General Public License for more details.
  9. # You should have received a copy of the GNU General Public License
  10. # along with this program; if not, write to the Free Software
  11. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  12. ################################################################################
  13. import pytest
  14. from .architecture import Architecture
  15. def test_Architecture(session):
  16. obj = Architecture('arch', 'description')
  17. session.add(obj)
  18. session.flush()
  19. get = Architecture.get(1, session)
  20. assert get
  21. assert get.arch_string == 'arch'
  22. assert get.description == 'description'
  23. def test_Architecture___eq__():
  24. obj = Architecture('arch')
  25. with pytest.warns(DeprecationWarning):
  26. assert obj == 'arch'
  27. with pytest.warns(DeprecationWarning):
  28. assert 'arch' == obj
  29. def test_Architecture___ne__():
  30. obj = Architecture('arch')
  31. with pytest.warns(DeprecationWarning):
  32. assert obj != 'zzzz'
  33. with pytest.warns(DeprecationWarning):
  34. assert 'zzzz' != obj