'''Test cases for QDeclarativeView'''

import unittest

from PySide.QtCore import QUrl, QStringList, QVariant
from PySide.QtGui import QPushButton
from PySide.QtDeclarative import QDeclarativeView

from helper import adjust_filename, TimedQApplication


class TestQDeclarativeView(TimedQApplication):

    def testQDeclarativeViewList(self):
        view = QDeclarativeView()

        dataList = QStringList(["Item 1", "Item 2", "Item 3", "Item 4"])

        ctxt = view.rootContext()
        ctxt.setContextProperty("myModel", dataList)

        url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
        view.setSource(url)
        view.show()

        self.assertEqual(view.status(), QDeclarativeView.Ready)

        self.app.exec_()

if __name__ == '__main__':
    unittest.main()

'''Test cases for QDeclarativeView'''

import unittest

from PySide.QtCore import QUrl
from PySide.QtDeclarative import QDeclarativeView

from helper import adjust_filename, TimedQApplication


class TestQDeclarativeView(TimedQApplication):

    def testQDeclarativeViewList(self):
        view = QDeclarativeView()

        dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]

        ctxt = view.rootContext()
        ctxt.setContextProperty("myModel", dataList)

        url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
        view.setSource(url)
        view.show()

        self.assertEqual(view.status(), QDeclarativeView.Ready)

        self.app.exec_()

if __name__ == '__main__':
    unittest.main()

Remove use of deprecated types.
Remove use of deprecated types.

Reviewer: Hugo Parente Lima <e250cbdf6b5a11059e9d944a6e5e9282be80d14c@openbossa.org>,
          Luciano Wolf <luciano.wolf@openbossa.org>

  '''Test cases for QDeclarativeView'''
  
  import unittest
  
+ from PySide.QtCore import QUrl
- from PySide.QtCore import QUrl, QStringList, QVariant
- from PySide.QtGui import QPushButton
  from PySide.QtDeclarative import QDeclarativeView
  
  from helper import adjust_filename, TimedQApplication
  
  
  class TestQDeclarativeView(TimedQApplication):
  
      def testQDeclarativeViewList(self):
          view = QDeclarativeView()
  
-         dataList = QStringList(["Item 1", "Item 2", "Item 3", "Item 4"])
+         dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]
  
          ctxt = view.rootContext()
          ctxt.setContextProperty("myModel", dataList)
  
          url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
          view.setSource(url)
          view.show()
  
          self.assertEqual(view.status(), QDeclarativeView.Ready)
  
          self.app.exec_()
  
  if __name__ == '__main__':
      unittest.main()
  
Remove use of deprecated types.
## Code Before:
'''Test cases for QDeclarativeView'''

import unittest

from PySide.QtCore import QUrl, QStringList, QVariant
from PySide.QtGui import QPushButton
from PySide.QtDeclarative import QDeclarativeView

from helper import adjust_filename, TimedQApplication


class TestQDeclarativeView(TimedQApplication):

    def testQDeclarativeViewList(self):
        view = QDeclarativeView()

        dataList = QStringList(["Item 1", "Item 2", "Item 3", "Item 4"])

        ctxt = view.rootContext()
        ctxt.setContextProperty("myModel", dataList)

        url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
        view.setSource(url)
        view.show()

        self.assertEqual(view.status(), QDeclarativeView.Ready)

        self.app.exec_()

if __name__ == '__main__':
    unittest.main()

## Instruction:
Remove use of deprecated types.
## Code After:
'''Test cases for QDeclarativeView'''

import unittest

from PySide.QtCore import QUrl
from PySide.QtDeclarative import QDeclarativeView

from helper import adjust_filename, TimedQApplication


class TestQDeclarativeView(TimedQApplication):

    def testQDeclarativeViewList(self):
        view = QDeclarativeView()

        dataList = ["Item 1", "Item 2", "Item 3", "Item 4"]

        ctxt = view.rootContext()
        ctxt.setContextProperty("myModel", dataList)

        url = QUrl.fromLocalFile(adjust_filename('view.qml', __file__))
        view.setSource(url)
        view.show()

        self.assertEqual(view.status(), QDeclarativeView.Ready)

        self.app.exec_()

if __name__ == '__main__':
    unittest.main()
