!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_reprs.py (3.39 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |

"""
This module contains tests for C{__repr__} implementations within Axiom, to
make sure they contain enough information to be useful, and work when objects
are incompletely initialized.
"""

from axiom.iaxiom import IOrdering
from axiom.attributes import integer, text, reference
from axiom.item import Item
from axiom.store import Store

from twisted.trial.unittest import TestCase

class ReprTesterItemClass(Item):
    intattr = integer()
    txtattr = text()

class ReprTesterWithReference(Item):
    """
    Test fixture for testing 'reference' attributes.
    """
    refattr = reference()


class BasicInformation(TestCase):
    """
    Basic tests to verify that C{__repr__} implementations for various axiom
    objects provide enough information to debug them.
    """

    def test_storeID(self):
        """
        Verify that the storeID column tells you that it is a storeID, and who
        it belongs to.
        """
        R = repr(ReprTesterItemClass.storeID)
        self.assertIn('storeID', R)
        self.assertIn(ReprTesterItemClass.__name__, R)
        self.assertNotIn('intattr', R)


    def test_query(self):
        """
        Verify that queries tell you something about their target and
        comparison.
        """
        s = Store()
        R = repr(s.query(ReprTesterItemClass,
                         ReprTesterItemClass.intattr == 1))
        self.assertIn('intattr', R)
        self.assertIn(ReprTesterItemClass.__name__, R)


    def test_simpleOrdering(self):
        """
        Verify that ordering objects tell you something about their ordering.
        """
        R = repr(ReprTesterItemClass.intattr.ascending)
        self.assertIn("intattr", R)
        self.assertIn("asc", R.lower()) # leaving this a little open-ended so
                                        # that we can fiddle with case, ASC and
                                        # DESC vs. ascending and descending

    def test_complexOrdering(self):
        """
        Verify that complex orderings tell us about their component parts.
        """
        R = repr(IOrdering((ReprTesterItemClass.intattr.ascending,
                            ReprTesterItemClass.txtattr.descending)))
        self.assertIn(repr(ReprTesterItemClass.intattr.ascending), R)
        self.assertIn(repr(ReprTesterItemClass.txtattr.descending), R)


    def test_referenceAttribute(self):
        """
        Verify that repr()ing an object with reference attributes will show the ID.
        """
        s = Store()
        i1 = ReprTesterWithReference(store=s)
        i2 = ReprTesterWithReference(store=s)
        i1.refattr = i2
        R = repr(i1)
        self.assertIn("reference(%d)" % (i2.storeID,), R)


    def test_recursiveReferenceAttribute(self):
        """
        Verify that repr()ing an object with reference attributes that refer to
        themselves will not recurse.
        """
        s = Store()
        i1 = ReprTesterWithReference(store=s)
        i1.refattr = i1
        R = repr(i1)
        self.assertIn("reference(%d)" % (i1.storeID,), R)


    def test_unstoredReferenceAttribute(self):
        """
        Verify that repr()ing an object with reference attributes that refer to
        items not in a store does something reasonable.
        """
        i1 = ReprTesterWithReference()
        i2 = ReprTesterWithReference()
        i1.refattr = i2
        R = repr(i1)
        self.assertIn("reference(unstored@%d)" % (id(i2),), R)



:: 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.0085 ]--