def test_single_date_itit(qtbot):
    widget = fgdc_date.FGDCDate(label='testing', show_format=False)
    qtbot.addWidget(widget)

    assert widget.ui.label.text() == 'testing'
    assert widget.ui.widget_format.isHidden()


    widget = fgdc_date.FGDCDate(label='testing', show_format=True)
    qtbot.addWidget(widget)

    assert not widget.ui.widget_format.isHidden()


# def test_single_date__to_xml(qtbot):
#     widget = single_date.single_date()
#     qtbot.addWidget(widget)
#
# 
#     widget._to_xml#(single_date)
#     #assert type(progress) == 'lxml.etree._Element'
#     widget.findChild(QLineEdit, 'fgdc_progress').currentText()# == 'Complete'
#     widget.findChild(QLineEdit, 'fgdc_update').currentText()# == 'Continually'
#
#     stat = widget._to_xml()
#
#     assert etree.tostring(stat, pretty_print=True).decode() \
#     == """<single_date>
#   <progress>Complete</progress>
#   <update>None planned</update>
# </single_date>
# """
Esempio n. 2
0
def test_single_date_itit(qtbot):
    widget = fgdc_date.FGDCDate(label='testing', show_format=False)
    qtbot.addWidget(widget)

    assert widget.ui.label.text() == 'testing'
    assert widget.ui.widget_format.isHidden()

    widget = fgdc_date.FGDCDate(label='testing', show_format=True)
    qtbot.addWidget(widget)

    assert not widget.ui.widget_format.isHidden()
Esempio n. 3
0
def test_metadata_date_to_xml(qtbot):
    widget = fgdc_date.FGDCDate()
    qtbot.addWidget(widget)


#     widget.ui.radioButton_2.setChecked(True)
#     timeWidget = widget.findChild(QStackedWidget, "fgdc_timeinfo")
#     timeWidget.setCurrentIndex(1)
#     begdate = "20131219"
#     enddate = "20140904"
#     date_edit2 = widget.range_date1.findChild(QLineEdit, "lineEdit")
#     date_edit2.setText(begdate)
#     date_edit3 = widget.range_date2.findChild(QLineEdit, "lineEdit")
#     date_edit3.setText(enddate)
#
#     mdDate = widget.to_xml()
#
#     assert etree.tostring(mdDate, pretty_print=True).decode()\
#     == """<timeperd>
#   <timeinfo>
#     <rngdates>
#       <begdate>20131219</begdate>
#       <enddate>20140904</enddate>
#     </rngdates>
#   </timeinfo>
#   <current></current>
# </timeperd>
# """
def test_single_date_setgetdate(qtbot):
    widget = fgdc_date.FGDCDate()
    qtbot.addWidget(widget)

    widget.ui.fgdc_caldate.setText('1234')
    assert widget.get_date() == '1234'

    widget.set_date('4567')
    assert widget.ui.fgdc_caldate.text() == '4567'
Esempio n. 5
0
def test_single_date_setgetdate(qtbot):
    widget = fgdc_date.FGDCDate()
    qtbot.addWidget(widget)

    widget.ui.fgdc_caldate.setText("1234")
    assert widget.get_date() == "1234"

    widget.set_date("4567")
    assert widget.ui.fgdc_caldate.text() == "4567"
Esempio n. 6
0
def test_metadata_date_to_xml(qtbot):
    widget = fgdc_date.FGDCDate()
    qtbot.addWidget(widget)