testing

Hypergeometric test (phyper)

主宰稳场 提交于 2019-12-31 08:12:34
问题 I've a question about the hypergeometric test. I've data like this : pop size : 5260 sample size : 131 Number of items in the pop that are classified as successes : 1998 Number of items in the sample that are classified as successes : 62 To compute a hypergeometric test, is that correct? phyper(62, 1998, 5260, 131) 回答1: Almost correct. If you look at ?phyper : phyper(q, m, n, k, lower.tail = TRUE, log.p = FALSE) x, q vector of quantiles representing the number of white balls drawn without

How to send a keyboard shortcut for a menu item with QTest?

浪尽此生 提交于 2019-12-31 04:01:08
问题 In a unit test, I'm trying to send the keyboard shortcut Command+N (on Mac OS), which corresponds to a menu item in my app. I'm using the PySide.QtTest module. In the code below, I'm using QTest.keyClicks , which doesn't produce what I'm expecting. The action corresponding to the shortcut is not called. class AppTestCase(TestCase): def setUp(self): qApp = QApplication.instance() if qApp is None: self.app = QApplication([]) else: self.app = qApp class IdfEditorTestCase(th.AppTestCase): def

Python Pytest unpack fixture

老子叫甜甜 提交于 2019-12-31 03:56:05
问题 I have a fixture that creates a list of items during tests. I want to have another fixture which is parametrized with values generated by the first one. Example code import random import pytest @pytest.fixture def values(): return [random.randint(0, 100) for _ in range(10)] @pytest.fixture def value(request): return request.param @pytest.mark.parametrize("value", params=values): def test_function(value): assert value > 0 The problem with above code is that values is a function and not a list.

Selenium IDE: Get row count in table

情到浓时终转凉″ 提交于 2019-12-31 03:49:04
问题 How do I get the row count of a given table using the Selenium IDE? When I right click on my table, I can only assert/verify the following: Title Value Text Table Element Present with the target being //div[@id='reports']/div[n]` where `n` is the number of rows. 回答1: You want to use the storeXpathCount command. This takes two parameters which can be stored within the IDE Target and Value fields where the following parameters are, respectively: xpath : the xpath expression to evaluate

Set errorlevel from batch-file

不羁岁月 提交于 2019-12-31 03:11:23
问题 I am working on this complicated (for me...) automation and one part is a batch script Started (not Called) from another one. Now, it's all work-in-progress and I'd like to be able to replace the Started batch script with a simple instruction that would do such that the Start-ing script, after having started the child script, has: %ERRORLEVEL% EQU 1 (And then I could work on the error-handling aspects and test stuff) But also something nice that doesn't put the system in an unnatural state

Testing a GeoDjango app with a PostGIS database

余生长醉 提交于 2019-12-31 03:07:12
问题 I am trying to enable testing on a brand new Django app. It has to run geometry tests. My Postgres installation in Postgres.app (with Postgis 2), my default database runs just fine (no problems with Django app syncing, creating, etc), but when I run manage.py test I get an error: django.db.utils.ProgrammingError: type "geography" does not exist LINE 4: "geom" geography(GEOMETRY,4326) NOT NULL Full errors: https://gist.github.com/dyve/11dcd455aa5a25628773 I know that Django creates a Postgres

Git remote for testing

隐身守侯 提交于 2019-12-31 02:42:08
问题 I've used to using Github as a backup or a central repository and doing both development and testing locally. Now I have a remote test machine and want to be able to push local commits to the remote such that the remotes working directory updates, allowing me to run tests on the contents. 1) Most of the instructions I have found for setting up remotes is to use a --bare init. As far as I understand, this means the remote lacks a working directory and accepts pushes. Setting up a remote

How can i test an Add function on CakePHP2.0

℡╲_俬逩灬. 提交于 2019-12-31 02:33:05
问题 I have been told that we have to test also the functions created by Cake like add/delete... If i have a function like this one, how can i test it if it doesn't have any return, redirect or even a view? ( i use ajax to execute it) public function add() { if ($this->request->is('post')) { $this->Comment->create(); if ($this->Comment->save($this->request->data)) { $this->Session->setFlash(__('The comment has been saved')); } else { $this->Session->setFlash(__('The comment could not be saved.

How to intercept debugging information ( Debugview style ) in C#?

☆樱花仙子☆ 提交于 2019-12-31 02:14:11
问题 For testing purposes I'm planning to put together a little app that will listen for a particular event coming from an application and interact with it at that point. Given that we're at a point in the testing process where changing the application code is out of the question, the ideal from my point of view would be to listen to the debugging trace from the application, a little like debugview does, and respond to that. Can anyone offer guidance on how best to go about this? 回答1: The way I

How to Install and run a XulRunner Application on Mac OS X?

一笑奈何 提交于 2019-12-30 23:25:10
问题 I'm on a Mac OS X Lion, and I have followed this tutorial exactly as it is: https://developer.mozilla.org/en/getting_started_with_xulrunner When I try to run: /Library/Frameworks/XUL.framework/xulrunner-bin --install-app /Users/CIRK/Documents/deskapp.zip Gives me nothing as a result in the terminal, and I can't find any file called deskapp.app . So I mean nothing happens at all. I tried to run it without the installation as it is suggested in the tutorial but doesn't worked : /Library