!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.16 (Debian). PHP/5.3.3-7+squeeze19 

uname -a: Linux mail.tri-specialutilitydistrict.com 2.6.32-5-amd64 #1 SMP Tue May 13 16:34:35 UTC
2014 x86_64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/pyshared/axiom/test/   drwxr-xr-x
Free 130 GB of 142.11 GB (91.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test_count.py (2.28 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
from twisted.trial.unittest import TestCase

from axiom.store import Store
from axiom.item import Item
from axiom.attributes import integer, AND, OR

class ThingsWithIntegers(Item):
    schemaVersion = 1
    typeName = 'axiom_test_thing_with_integers'

    a = integer()
    b = integer()


class NotARealThing(Item):
    schemaVersion = 1
    typeName = 'axiom_test_never_created_item'

    irrelevantAttribute = integer()

    def __init__(self, **kw):
        raise NotImplementedError("You cannot create things that are not real!")


class TestCountQuery(TestCase):

    RANGE = 10
    MIDDLE = 5


    def assertCountEqualsQuery(self, item, cond = None):
        self.assertEquals(self.store.count(item, cond),
                          len(list(self.store.query(item, cond))),
                          'count and len(list(query)) not equals: %r,%r'%(item, cond))

    def setUp(self):
        self.store = Store()
        def populate():
            for i in xrange(self.RANGE):
                for j in xrange(self.RANGE):
                    ThingsWithIntegers(store = self.store, a = i, b = j)
        self.store.transact(populate)

    def testBasicCount(self):
        self.assertCountEqualsQuery(ThingsWithIntegers)

    def testSimpleConditionCount(self):
        self.assertCountEqualsQuery(ThingsWithIntegers,
                                    ThingsWithIntegers.a > self.MIDDLE)

    def testTwoFieldsConditionCount(self):
        self.assertCountEqualsQuery(ThingsWithIntegers,
                                    ThingsWithIntegers.a == ThingsWithIntegers.b)

    def testANDConditionCount(self):
        self.assertCountEqualsQuery(ThingsWithIntegers,
                                    AND(ThingsWithIntegers.a > self.MIDDLE, ThingsWithIntegers.b < self.MIDDLE))

    def testORConditionCount(self):
        self.assertCountEqualsQuery(ThingsWithIntegers,
                                    OR(ThingsWithIntegers.a > self.MIDDLE, ThingsWithIntegers.b < self.MIDDLE))

    def testEmptyResult(self):
        self.assertCountEqualsQuery(ThingsWithIntegers,
                                    ThingsWithIntegers.a == self.RANGE + 3)

    def testNonExistentTable(self):
        self.assertCountEqualsQuery(NotARealThing,
                                    NotARealThing.irrelevantAttribute == self.RANGE + 3)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0174 ]--