Hi, I'm learning how to use autopilot and wanted to interrogate a value.

This involves the calendar app. Here is the output, followed by what I
tried. Where did I go wrong?

  File
"/home/cecil/Workspace/ubuntu-calendar-app/tests/autopilot/calendar_app/tests/test_calendar_current_day_of_month.py",
line 30, in test_day_of_month
    print intern.today
AttributeError: 'NoneType' object has no attribute 'today'

In the emulator dir, I added this to main_window.py:

   def get_intern(self):

        return self.app.select_single("intern")


In the tests dir, I created this new test:

... elided ...

class TestDayOfMonth(CalendarTestCase):

    def setUp(self):

        super(TestDayOfMonth, self).setUp()

        self.assertThat(

            self.main_window.get_qml_view().visible, Eventually(Equals(True)))

    def tearDown(self):

        super(TestDayOfMonth, self).tearDown()


    def test_day_of_month(self):

        intern = self.main_window.get_intern()

        print intern.today


What I'm trying to see is in MonthView.qml starting around line 89:

    QtObject {

        id: intern


        property int squareUnit: monthView.width / 8

        property int verticalMargin: units.gu(1)

        property int weekstartDay: Qt.locale().firstDayOfWeek

        property int monthCount: 49 // months for +-2 years


        property var today: (new Date()).midnight() // TODO: update at midnight

        property var currentDayStart: today

        property int monthIndex0: Math.floor(monthCount / 2)

        property var monthStart0: today.monthStart()

    }
-- 
Ubuntu-quality mailing list
Ubuntu-quality@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-quality

Reply via email to