Exemplo n.º 1
0
    def test_adjust_for_search(self):
        expected = "244"
        actual = VistaUtils.adjust_for_search("245")
        self.assertEqual(expected, actual)

        expected = "Snurc~"
        actual = VistaUtils.adjust_for_search("Snurd")
        self.assertEqual(expected, actual)
Exemplo n.º 2
0
    def test_adjust_for_search(self):
        expected = "244"
        actual = VistaUtils.adjust_for_search("245")
        self.assertEqual(expected, actual)

        expected = "Snurc~"
        actual = VistaUtils.adjust_for_search("Snurd")
        self.assertEqual(expected, actual)
Exemplo n.º 3
0
    def __prepare_param_list(self):
        if not getattr(self, 'file', None):
            raise VistaException('VistaSelect must specify a file')
        self.param_list = [('"FILE"', self.file)]

        if getattr(self, 'iens', None):
            self.param_list += [('"IENS"', self.iens)]

        self.param_list += [('"FIELDS"', getattr(self, 'fields', '@'))]

        self.param_list += [('"FLAGS"', getattr(self, 'flags', 'IP'))]

        if getattr(self, 'number', None):
            self.param_list += [('"MAX"', str(self.number))]

        if getattr(self, 'frum', None):
            self.param_list += [('"FROM"', VistaUtils.adjust_for_search(self.frum))]

        if getattr(self, 'part', None):
            self.param_list += [('"PART"', self.part)]

        self.param_list += [('"XREF"', getattr(self, 'index', '#'))]

        if getattr(self, 'screen', None):
            self.param_list += [('"SCREEN"', self.screen)]

        if getattr(self, 'identifier', None):
            self.param_list += [('"ID"', self.identifier)]

        return self.param_list
Exemplo n.º 4
0
    def __prepare_param_list(self):
        if not getattr(self, 'file', None):
            raise VistaException('VistaSelect must specify a file')
        self.param_list = [('"FILE"', self.file)]

        if getattr(self, 'iens', None):
            self.param_list += [('"IENS"', self.iens)]

        self.param_list += [('"FIELDS"', getattr(self, 'fields', '@'))]

        self.param_list += [('"FLAGS"', getattr(self, 'flags', 'IP'))]

        if getattr(self, 'number', None):
            self.param_list += [('"MAX"', str(self.number))]

        if getattr(self, 'frum', None):
            self.param_list += [('"FROM"',
                                 VistaUtils.adjust_for_search(self.frum))]

        if getattr(self, 'part', None):
            self.param_list += [('"PART"', self.part)]

        self.param_list += [('"XREF"', getattr(self, 'index', '#'))]

        if getattr(self, 'screen', None):
            self.param_list += [('"SCREEN"', self.screen)]

        if getattr(self, 'identifier', None):
            self.param_list += [('"ID"', self.identifier)]

        return self.param_list