Python test.test_support.get_attribute() Examples

The following are 16 code examples of test.test_support.get_attribute(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module test.test_support , or try the search function .
Example #1
Source File: test_sysconfig.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_symlink(self):
        # Issue 7880
        symlink = get_attribute(os, "symlink")
        def get(python):
            cmd = [python, '-c',
                   'import sysconfig; print sysconfig.get_platform()']
            p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
            return p.communicate()
        real = os.path.realpath(sys.executable)
        link = os.path.abspath(TESTFN)
        symlink(real, link)
        try:
            self.assertEqual(get(real), get(link))
        finally:
            unlink(link) 
Example #2
Source File: test_smtpnet.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_connect(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
        server.ehlo()
        server.quit() 
Example #3
Source File: test_smtpnet.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_connect_default_port(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer)
        server.ehlo()
        server.quit() 
Example #4
Source File: test_sysconfig.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_symlink(self):
        # Issue 7880
        symlink = get_attribute(os, "symlink")
        def get(python):
            cmd = [python, '-c',
                   'import sysconfig; print sysconfig.get_platform()']
            p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
            return p.communicate()
        real = os.path.realpath(sys.executable)
        link = os.path.abspath(TESTFN)
        symlink(real, link)
        try:
            self.assertEqual(get(real), get(link))
        finally:
            unlink(link) 
Example #5
Source File: test_smtpnet.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_connect(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
        server.ehlo()
        server.quit() 
Example #6
Source File: test_smtpnet.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_connect_default_port(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer)
        server.ehlo()
        server.quit() 
Example #7
Source File: test_sysconfig.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_symlink(self):
        # Issue 7880
        symlink = get_attribute(os, "symlink")
        def get(python):
            cmd = [python, '-c',
                   'import sysconfig; print sysconfig.get_platform()']
            p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
            return p.communicate()
        real = os.path.realpath(sys.executable)
        link = os.path.abspath(TESTFN)
        symlink(real, link)
        try:
            self.assertEqual(get(real), get(link))
        finally:
            unlink(link) 
Example #8
Source File: test_smtpnet.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_connect(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
        server.ehlo()
        server.quit() 
Example #9
Source File: test_smtpnet.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_connect_default_port(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer)
        server.ehlo()
        server.quit() 
Example #10
Source File: test_sysconfig.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_symlink(self):
        # Issue 7880
        symlink = get_attribute(os, "symlink")
        def get(python):
            cmd = [python, '-c',
                   'import sysconfig; print sysconfig.get_platform()']
            p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
            return p.communicate()
        real = os.path.realpath(sys.executable)
        link = os.path.abspath(TESTFN)
        symlink(real, link)
        try:
            self.assertEqual(get(real), get(link))
        finally:
            unlink(link) 
Example #11
Source File: test_smtpnet.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_connect(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
        server.ehlo()
        server.quit() 
Example #12
Source File: test_smtpnet.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_connect_default_port(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer)
        server.ehlo()
        server.quit() 
Example #13
Source File: test_smtpnet.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_connect(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
        server.ehlo()
        server.quit() 
Example #14
Source File: test_smtpnet.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_connect_default_port(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer)
        server.ehlo()
        server.quit() 
Example #15
Source File: test_smtpnet.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_connect(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
        server.ehlo()
        server.quit() 
Example #16
Source File: test_smtpnet.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_connect_default_port(self):
        test_support.get_attribute(smtplib, 'SMTP_SSL')
        with test_support.transient_internet(self.testServer):
            server = smtplib.SMTP_SSL(self.testServer)
        server.ehlo()
        server.quit()